123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\user\controller;
- use think\App;
- class SystemLog extends Base{
- public function __construct(App $app) {
- $this->noLogin=["*"];
- parent::__construct($app);
- $this->model = new \app\user\model\SystemLog();
- }
- public function list(){
- $params = $this->request->param(["system"=>"","controller"=>"","action"=>"","uid"=>'',"page"=>1,"size"=>10,
- "start"=>"","end"=>""],"post","trim");
- $where=[];
- if($params['system']!='') $where[]=['system','=',$params['system']];
- if($params['controller']!='') $where[]=['controller','=',$params['controller']];
- if($params['action']!='') $where[]=['action','=',$params['action']];
- if($params['uid']!='') $where[]=['action_id','=',$params['uid']];
- if($params['start']!='' && $params['end']!=''){
- $where[]=['createTime','between',[$params['start'],$params['end']]];
- }
- $list = $this->model->where($where)->order('id desc')
- ->paginate(["page"=>$params['page'],"list_rows"=>$params['size']]);
- return success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
- }
- }
|