mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-05 17:42:49 +08:00
实现后台操作日志记录;
This commit is contained in:
40
app/model/AdminLog.php
Normal file
40
app/model/AdminLog.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* @mixin think\Model
|
||||
*/
|
||||
class AdminLog extends Model
|
||||
{
|
||||
//
|
||||
use SoftDelete;
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('Admin','admin_id');
|
||||
}
|
||||
|
||||
public function getUrlAttr()
|
||||
{
|
||||
return AdminPermission::where([
|
||||
'app'=>$this->getData('app'),
|
||||
'controller'=>$this->getData('controller'),
|
||||
'action'=>$this->getData('action'),
|
||||
])->find();
|
||||
}
|
||||
|
||||
public function setParamAttr($value)
|
||||
{
|
||||
return json_encode($value,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
public function getParamAttr($value)
|
||||
{
|
||||
return \mb_substr($value,0,30);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user