完成新的安装流程,开始优化日志管理;

This commit is contained in:
2022-04-19 22:16:58 +08:00
parent e29f8ff4ea
commit 7852f602bb
22 changed files with 296 additions and 207 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace app\admin\controller\debug;
use app\common\controller\AdminController;
use EasyAdmin\annotation\ControllerAnnotation;
use EasyAdmin\annotation\NodeAnotation;
use think\App;
/**
* @ControllerAnnotation(title="debug_log")
*/
class Log 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();
}
}

View File

@@ -1,67 +0,0 @@
<?php
namespace app\admin\controller\system;
use app\admin\model\SystemLog;
use app\common\controller\AdminController;
use EasyAdmin\annotation\ControllerAnnotation;
use EasyAdmin\annotation\NodeAnotation;
use think\App;
/**
* @ControllerAnnotation(title="操作日志管理")
* Class Auth
* @package app\admin\controller\system
*/
class Log extends AdminController
{
public function __construct(App $app)
{
parent::__construct($app);
$this->model = new SystemLog();
}
/**
* @NodeAnotation(title="列表")
*/
public function index()
{
if ($this->request->isAjax()) {
if (input('selectFields')) {
return $this->selectList();
}
[$page, $limit, $where, $excludeFields] = $this->buildTableParames(['month']);
$month = (isset($excludeFields['month']) && !empty($excludeFields['month']))
? date('Ym',strtotime($excludeFields['month']))
: date('Ym');
// todo TP6框架有一个BUG非模型名与表名不对应时name属性自定义withJoin生成的sql有问题
$count = $this->model
->setMonth($month)
->with('admin')
->where($where)
->select();
$list = $this->model
->setMonth($month)
->with('admin')
->where($where)
->page($page, $limit)
->order($this->sort)
->select();
$data = [
'code' => 0,
'msg' => '',
'count' => $count,
'data' => $list,
];
return json($data);
}
return $this->fetch();
}
}