mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
69 lines
1.9 KiB
PHP
69 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace base\admin\controller\debug;
|
|
|
|
use app\admin\service\annotation\ControllerAnnotation;
|
|
use app\common\controller\AdminController;
|
|
use think\App;
|
|
|
|
/**
|
|
* @ControllerAnnotation(title="debug_log")
|
|
*/
|
|
class LogBase extends AdminController
|
|
{
|
|
protected $sort = [
|
|
'uid' => 'desc',
|
|
'id' => 'asc',
|
|
];
|
|
|
|
use \app\admin\traits\Curd;
|
|
|
|
public function __construct(App $app)
|
|
{
|
|
parent::__construct($app);
|
|
|
|
$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, level')->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')),
|
|
'levels' => array_unique($distinctData->column('level')),
|
|
]);
|
|
|
|
return $this->fetch();
|
|
}
|
|
}
|