selectActionLog($page,$size,$name,$startTime,$endTime); HelpHander::success($ret); } // 日志列表 private function selectActionLog($page,$size,$name,$startTime,$endTime){ if($name){ $map[] = ['ui.name','like','%'.$name.'%']; } if($startTime&&$endTime){ $map[] = ['al.create_time','>=',$startTime]; $map[] = ['al.create_time','<=',$endTime]; } $map = !empty($map)?$map:true; $lists = Db::name('del_log') ->alias('al') ->join('user_info ui','ui.user_id = al.user_id') ->where($map) ->page($page,$size) ->field('al.*,ui.name') ->order('al.id desc') ->select(); $total = Db::name('del_log') ->alias('al') ->join('user_info ui','ui.user_id = al.user_id') ->where($map)->count(); $data = [ 'total' => $total, 'list' => $lists?$lists:[] ]; return $data; } }