123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\admin\controller;
- use app\BaseController;
- use think\App;
- use think\facade\Db;
- //客户信息
- class Listcustomer extends Base
- {
- public function list(){
- $param = $this->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]);
- }
- }
|