新增模型
This commit is contained in:
parent
011c138439
commit
d044ac6d8a
22
catch/system/model/LoginLog.php
Normal file
22
catch/system/model/LoginLog.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
namespace catchAdmin\system\model;
|
||||||
|
|
||||||
|
use catcher\base\CatchModel;
|
||||||
|
use catcher\traits\db\BaseOptionsTrait;
|
||||||
|
|
||||||
|
class LoginLog extends \think\Model
|
||||||
|
{
|
||||||
|
use BaseOptionsTrait;
|
||||||
|
|
||||||
|
protected $name = 'login_log';
|
||||||
|
|
||||||
|
protected $field = [
|
||||||
|
'id', //
|
||||||
|
'login_name', // 用户名
|
||||||
|
'login_ip', // 登录地点ip
|
||||||
|
'browser', // 浏览器
|
||||||
|
'os', // 操作系统
|
||||||
|
'login_at', // 登录时间
|
||||||
|
'status', // 1 成功 2 失败
|
||||||
|
];
|
||||||
|
}
|
40
catch/system/model/OperateLog.php
Normal file
40
catch/system/model/OperateLog.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
namespace catchAdmin\system\model;
|
||||||
|
|
||||||
|
use catchAdmin\permissions\model\Users;
|
||||||
|
use catcher\traits\db\BaseOptionsTrait;
|
||||||
|
|
||||||
|
class OperateLog extends \think\Model
|
||||||
|
{
|
||||||
|
use BaseOptionsTrait;
|
||||||
|
|
||||||
|
protected $name = 'operate_log';
|
||||||
|
|
||||||
|
protected $field = [
|
||||||
|
'id', //
|
||||||
|
'module', // 模块名称
|
||||||
|
'operate', // 操作模块
|
||||||
|
'route', // 路由
|
||||||
|
'params', // 参数
|
||||||
|
'ip', // ip
|
||||||
|
'creator_id', // 创建人ID
|
||||||
|
'method', // 请求方法
|
||||||
|
'created_at', // 登录时间
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get list
|
||||||
|
*
|
||||||
|
* @time 2020年04月28日
|
||||||
|
* @param $params
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function getList()
|
||||||
|
{
|
||||||
|
return $this->field([$this->aliasField('*')])
|
||||||
|
->catchJoin(Users::class, 'id', 'creator_id', ['username as creator'])
|
||||||
|
->order($this->aliasField('id'), 'desc')
|
||||||
|
->paginate();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user