Listcustomer.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\admin\controller;
  3. use app\BaseController;
  4. use think\App;
  5. use think\facade\Db;
  6. //客户信息
  7. class Listcustomer extends Base
  8. {
  9. public function list(){
  10. $param = $this->request->only([
  11. 'page'=>1,
  12. 'size'=>10,
  13. 'companyNo'=>'',
  14. 'companyName'=>'',
  15. 'itemid'=>'',
  16. ],'post','trim');
  17. $userCommon = \app\admin\common\User::getIns();
  18. $rs = $userCommon->handle('cTitle', $param);
  19. return json_show($rs['code'], $rs['message'],$rs['data']);
  20. // $page = isset($this->post['page'])&& $this->post['page'] !=="" ? intval($this->post['page']) :"1";
  21. // $size = isset($this->post['size']) && $this->post['size'] !=="" ? intval($this->post['size']) :"10";
  22. // $where []= ['is_del',"=",0];
  23. // $companyNo= isset($this->post['companyNo'])&&$this->post['companyNo']!=="" ? trim($this->post['companyNo']):"";
  24. // if($companyNo!=""){
  25. // $where[]=["companyNo","like","%$companyNo%"];
  26. // }
  27. // $companyName= isset($this->post['companyName'])&&$this->post['companyName']!=="" ? trim($this->post['companyName']):"";
  28. // if($companyName!=""){
  29. // $where[]=["companyName","like","%$companyName%"];
  30. // }
  31. // $itemid = isset($this->post['itemid']) && $this->post['itemid'] !=="" ? intval($this->post['itemid']):"";
  32. // if($itemid!=""){
  33. // $where[]=["itemid","=",$itemid];
  34. // }
  35. // $count = Db::name('customer_info')->where($where)->count();
  36. // $total = ceil($count/$size);
  37. // $page = $page >= $total ? $total : $page;
  38. // $item = Db::name('customer_info')->where($where)
  39. // ->field("*,LENGTH(companyName) as weight")->order("weight asc")->page($page,$size)->select();
  40. // return app_show(0,"获取成功",['item'=>$item,'count'=>$count]);
  41. }
  42. }