request->only([ 'page'=>1, 'size'=>10, 'companyNo'=>'', 'companyName'=>'', 'itemid'=>'', ],'post','trim'); $userCommon = \app\admin\common\User::getIns(); $rs = $userCommon->handle('cTitle', $param); return json_show($rs['code'], $rs['message'],$rs['data']); // $page = isset($this->post['page'])&& $this->post['page'] !=="" ? intval($this->post['page']) :"1"; // $size = isset($this->post['size']) && $this->post['size'] !=="" ? intval($this->post['size']) :"10"; // $where []= ['is_del',"=",0]; // $companyNo= isset($this->post['companyNo'])&&$this->post['companyNo']!=="" ? trim($this->post['companyNo']):""; // if($companyNo!=""){ // $where[]=["companyNo","like","%$companyNo%"]; // } // $companyName= isset($this->post['companyName'])&&$this->post['companyName']!=="" ? trim($this->post['companyName']):""; // if($companyName!=""){ // $where[]=["companyName","like","%$companyName%"]; // } // $itemid = isset($this->post['itemid']) && $this->post['itemid'] !=="" ? intval($this->post['itemid']):""; // if($itemid!=""){ // $where[]=["itemid","=",$itemid]; // } // $count = Db::name('customer_info')->where($where)->count(); // $total = ceil($count/$size); // $page = $page >= $total ? $total : $page; // $item = Db::name('customer_info')->where($where) // ->field("*,LENGTH(companyName) as weight")->order("weight asc")->page($page,$size)->select(); // return app_show(0,"获取成功",['item'=>$item,'count'=>$count]); } }