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']])->each(function($item,$key){ $item->action_msg = \SystemLog::GET_LOG_PATH($item->toArray(),$item->action_name,$item->param); }); return success("获取成功",["list"=>$list->items(),"count"=>$list->total()]); } }