50 ? 50 : (int)$post["pageSize"]; $post["page"] = $post["page"]<=0 ? 1 : (int)$post["page"]; $where=[]; if(isset($post["status"]) && in_array((string)$post["status"], ["0","1"])){ $where[]=["status","=",(int)$post["status"]]; } if(!empty($post["title"])){ $where[]=["title","like","%{$post["title"]}%"]; } $totalCount = $this->where($where)->count(); $data=null; if($totalCount>0){ $data = $this ->field($field) ->where($where) ->order("seq", "desc") ->page($post["page"], $post["pageSize"]) ->select(); if(!empty($data)){ $data = $data->toArray(); } } $data = empty($data)?[]:$data; return ["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount]; } }