初始字段

$fields = [
    "log_id",//日志ID
    "log_user_id",//用户ID
    "log_info_id",//内容ID
    "log_value",//日志值
    "log_decimal",//小数类型的值
    "log_status",//状态(normal|hidden)
    "log_module",//应用名
    "log_controll",//控制器
    "log_action",//操作名
    "log_type",//类型(adminLogs|userScore|自定义)
    "log_ip",//ip
    "log_name",//名称
    "log_info",//详细描述
    "log_create_time",//时间戳
];

新增一条日志的实例

$data = [];
$data['log_user_id']  = $this->site['user']['user_id'];
$data['log_info_id']  = 0;
$data['log_module']   = $this->site['module'];
$data['log_controll'] = $this->site['controll'];
$data['log_action']   = $this->site['action'];
$data['log_type']     = 'adminLogs';
$data['log_ip']       = $this->request->ip();
$data['log_name']     = $this->site['module'].'/'.$this->site['controll'].'/'.$this->site['action'];
$data['log_info']     = $this->request->header('user-agent');
return model('common/Log','loglic')->save($data);

删除一条日志的实例

return model('common/Log','loglic')->delete([
    'log_id' => 88,
]);

查询一条日志的实例

return model('common/Log','loglic')->get([
    'log_id' => 88,
]);

删除多条日志的实例

return model('common/Log','loglic')->all([
    'cache'     => true,
    'field'     => 'log_id,log_name',
    'sort'      => 'log_id',
    'order'     => 'desc',
    'limit'     => 10,
    'paginate'  => '',
    'where'     => [
        'log_id' => ['gt',88],
    ],
]);