mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 增加按应用、控制器、方法查询日志
This commit is contained in:
@@ -24,4 +24,44 @@ class LogBase extends AdminController
|
||||
|
||||
$this->model = new \app\admin\model\DebugLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
if (input('selectFields')) {
|
||||
return $this->selectList();
|
||||
}
|
||||
list($page, $limit, $where, $excludes, $request_options, $group) = $this->buildTableParames();
|
||||
$count = $this->model
|
||||
->where($where)
|
||||
->group($group)
|
||||
->count();
|
||||
$list = $this->model
|
||||
->where($where)
|
||||
->page($page, $limit)
|
||||
->order($this->sort)
|
||||
->group($group)
|
||||
->select();
|
||||
$data = [
|
||||
'code' => 0,
|
||||
'msg' => '',
|
||||
'count' => $count,
|
||||
'data' => $list,
|
||||
];
|
||||
|
||||
return json($data);
|
||||
}
|
||||
|
||||
$distinctData = $this->model->field('app_name, controller_name, action_name')->distinct(true)->select();
|
||||
$this->assign([
|
||||
'apps' => array_unique($distinctData->column('app_name')),
|
||||
'controllers' => array_unique($distinctData->column('controller_name')),
|
||||
'actions' => array_unique($distinctData->column('action_name')),
|
||||
]);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user