浏览代码

业务参数列表添加所属部门筛选条件

wufeng 2 年之前
父节点
当前提交
f65d91000b

+ 27 - 14
app/admin/controller/Business.php

@@ -127,37 +127,50 @@ class Business extends Base
     public function list(){
         $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]];
+        $where = [["b.is_del","=",0]];
         $company = isset($this->post['company']) && $this->post['company'] !=="" ? trim($this->post['company']):"";
         if($company!==""){
-            $where[]=['company',"like","%$company%"];
+            $where[]=['b.company',"like","%$company%"];
         }
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
         if($status!==""){
-            $where[]=['status',"=",$status];
+            $where[]=['b.status',"=",$status];
         }
         $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
         if($creater!==""){
-            $where[]=['creater',"like","%$creater%"];
+            $where[]=['b.creater',"like","%$creater%"];
         }
         $start = isset($this->post['start']) && $this->post['start']!=="" ? $this->post['start']:"";
         if($start!==""){
-            $where[]=['addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
+            $where[]=['b.addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
         }
         $end = isset($this->post['end']) && $this->post['end']!=="" ? $this->post['end']:"";
         if($end!==""){
-            $where[]=['addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
+            $where[]=['b.addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
         }
-        $count = Db::name('business') ->where($where)->count();
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["b.createrid", 'in', get_company_item_user_by_name($company_name)];
+
+
+        $count = Db::name('business')
+            ->alias('b')
+            ->where($where)
+            ->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
-        $list = Db::name('business')->where($where)->page($page,$size)->field("id,company,companyNo,status,creater,addtime,type")->order("addtime desc")->select();
-//        $data=[];
-//        foreach ($list as $value){
-//            $info = Db::name('company_type')->where(['id'=>$value['type'],"is_del"=>0])->find();
-//            $value['companytype']=isset($info['company_type'])?$info['company_type']:"";
-//            $data[]=$value;
-//        }
+        $list = Db::name('business')
+            ->alias('b')
+            ->where($where)
+            ->page($page,$size)
+            ->field("b.id,b.company,b.companyNo,b.status,b.creater,b.addtime,b.type,u.itemid")
+            ->leftJoin("depart_user u", "u.uid=b.createrid AND u.is_del=0")
+            ->order("addtime desc")
+            ->append(['company_name'])
+            ->withAttr('company_name',function ($val,$data){
+                return implode('/', array_column(GetPart($data['itemid']), 'name'));
+            })
+            ->select()
+            ->toArray();
 
         return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
     }

+ 21 - 10
app/admin/controller/Customer.php

@@ -20,18 +20,18 @@ class Customer extends Base
         $size = isset($this->post['size']) && $this->post['size'] != "" ? intval($this->post['size']) :"10";
         $pid =  isset($this->post['pid']) &&$this->post['pid']!=="" ?intval($this->post['pid']): "0";
         $where =[];
-        $where []= ['is_del',"=",0];
+        $where []= ['ci.is_del',"=",0];
         $condition = [['is_del',"=",0]];
         if($pid!==""){
             $condition[]=["pid","=",$pid];
         }
         $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !=="" ? trim($this->post['companyNo']):"";
         if($companyNo !==""){
-            $where[] = ['companyNo',"like","%$companyNo%"];
+            $where[] = ['ci.companyNo',"like","%$companyNo%"];
         }
         $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
         if($creater !==""){
-            $where[] = ['creater',"like","%$creater%"];
+            $where[] = ['ci.creater',"like","%$creater%"];
         }
         $name= isset($this->post['name'])&&$this->post['name']!=="" ? trim($this->post['name']):"";
         if($name!=""){
@@ -39,15 +39,15 @@ class Customer extends Base
         }
         $start = isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start'] : "";
         if ($start != "") {
-            $where[] = ["addtime", '>=', $start];
+            $where[] = ["ci.addtime", '>=', $start];
         }
         $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] : "";
         if ($end != "") {
-            $where[] = ["addtime", '<=', $end];
+            $where[] = ["ci.addtime", '<=', $end];
         }
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
         if($status!==""){
-            $where[] = ['status',"=",$status];
+            $where[] = ['ci.status',"=",$status];
         }
 //        $count = Db::name('customer_org1')->where($condition)->count();
 //        $page>=ceil($count/$size) ? $page=ceil($count/$size) :"";
@@ -71,15 +71,18 @@ class Customer extends Base
         if($status!==""){
             $condition[] = ['status',"=",$status];
         }
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["u.uid", 'in', get_company_item_user_by_name($company_name)];
+
         $pidlist = Db::name("customer_org1")->where($condition)->order("addtime desc")->column("pid");
         if(!empty($pidlist)){
-            $where[]=[["itemid","in",$pidlist]];
+            $where[]=[["ci.itemid","in",$pidlist]];
 
         }else{
             if($pid===""){
-                $where[]=['itemid','=',0];
+                $where[]=['ci.itemid','=',0];
             }else{
-                $where[]=['itemid','=',$pid];
+                $where[]=['ci.itemid','=',$pid];
             }
         }
         $list = Db::name('customer_org1')->where($condition)->order("addtime desc")->column("id,pid,name,level,depart_link,creater,addtime,status");
@@ -95,7 +98,14 @@ class Customer extends Base
             $iten['kh']=0;//组织架构
             $var[]=$iten;
         }
-        $itm = Db::name('customer_info')->order("addtime desc")->where($where)->select();
+        $itm = Db::name('customer_info')
+            ->alias('ci')
+            ->field('ci.*,u.itemid')
+            ->leftJoin("depart_user u", "u.nickname=ci.creater AND u.is_del=0")
+            ->where($where)
+            ->order("ci.addtime desc")
+            ->select()
+            ->toArray();
         foreach ($itm as $vat){
             $inm=[];
             $inm['name']=$vat['companyName'];
@@ -116,6 +126,7 @@ class Customer extends Base
             $inm['creater']=$vat['creater'];
             $inm['addtime']=$vat['addtime'];
             $inm['kh']=1;//客户
+            $inm['company_name'] = implode('/', array_column(GetPart($vat['itemid']), 'name'));
             $var[]=$inm;
         }
         return app_show(0,"获取成功",$var);

+ 19 - 6
app/admin/controller/Exclusive.php

@@ -20,23 +20,36 @@ class Exclusive extends Base
     public function list(){
         $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]];
+        $where =[["e.is_del","=",0]];
         $cat_name=isset($this->post['name']) && $this->post['name'] !==""? trim($this->post['name']) :"";
         if($cat_name!==""){
-            $where[]=['name',"like","%$cat_name%"];
+            $where[]=['e.name',"like","%$cat_name%"];
         }
         $pid=isset($this->post['pid']) && $this->post['pid'] !==""? intval($this->post['pid']) :"";
         if($pid!==""){
-            $where[]=['pid',"=",$pid];
+            $where[]=['e.pid',"=",$pid];
         }
         $status=isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']) :"";
         if($status!==""){
-            $where[]=['status',"=",$status];
+            $where[]=['e.status',"=",$status];
         }
-        $count = Db::name("exclusive")->where($where)->count();
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["e.createrid", 'in', get_company_item_user_by_name($company_name)];
+
+        $count = Db::name("exclusive")->alias('e')->where($where)->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
-        $list = Db::name('exclusive')->where($where)->page($page, $size)->select();
+        $list = Db::name('exclusive')
+            ->alias('e')
+            ->field('e.*,u.itemid')
+            ->leftJoin("depart_user u", "u.uid=e.createrid AND u.is_del=0")
+            ->append(['company_name'])
+            ->withAttr('company_name',function ($val,$data){
+                return implode('/', array_column(GetPart($data['itemid']), 'name'));
+            })
+            ->where($where)
+            ->page($page, $size)
+            ->select();
         return app_show(0, "获取成功", ['list' =>$list, 'count' => $count]);
     }
 

+ 27 - 9
app/admin/controller/Orderuse.php

@@ -50,32 +50,50 @@ class Orderuse extends BaseController
     public function list(){
         $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]];
+        $where =[['ou.is_del',"=",0]];
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
         if($status !==""){
-            $where [] = ['status',"=",$status];
+            $where [] = ['ou.status',"=",$status];
         }
         $order_use = isset($this->post['order_use']) && $this->post['order_use'] !=="" ? trim($this->post['order_use']):"";
         if($order_use !==""){
-            $where [] =['order_use',"like","%$order_use%"];
+            $where [] =['ou.order_use',"like","%$order_use%"];
         }
         $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
         if($creater !==""){
-            $where [] =['creater',"like","%$creater%"];
+            $where [] =['ou.creater',"like","%$creater%"];
         }
         $start = isset($this->post['start']) && $this->post['start']!=="" ? $this->post['start']:"";
         if($start!==""){
-            $where[]=['addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
+            $where[]=['ou.addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
         }
         $end = isset($this->post['end']) && $this->post['end']!=="" ? $this->post['end']:"";
         if($end!==""){
-            $where[]=['addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
+            $where[]=['ou.addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
         }
-        $count = Db::name('order_use')->where($where)->count();
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["ou.createrid", 'in', get_company_item_user_by_name($company_name)];
+
+        $count = Db::name('order_use')
+            ->alias('ou')
+            ->where($where)
+            ->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total :$page;
-        $list = Db::name('order_use')->where($where)->page($page,$size)->order("addtime desc")->select();
-        return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
+        $list = Db::name('order_use')
+            ->alias('ou')
+            ->field('ou.*,u.itemid')
+            ->leftJoin("depart_user u", "u.uid=ou.createrid AND u.is_del=0")
+            ->where($where)
+            ->page($page, $size)
+            ->append(['company_name'])
+            ->withAttr('company_name', function ($val, $data) {
+                return implode('/', array_column(GetPart($data['itemid']), 'name'));
+            })
+            ->order("addtime desc")
+            ->select()
+            ->toArray();
+        return app_show(0, "获取成功", ["list" => $list, "count" => $count]);
     }
     public function edit(){
         $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) :"";

+ 24 - 9
app/admin/controller/Platform.php

@@ -64,39 +64,54 @@ class Platform extends Base
     public function list(){
         $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]];
+        $where=[["p.is_del","=",0]];
         $platform_name = isset($this->post['platform_name']) && $this->post['platform_name'] !=="" ? trim($this->post['platform_name']):"";
         if($platform_name!=""){
-            $where[]=['platform_name',"like","%$platform_name%"];
+            $where[]=['p.platform_name',"like","%$platform_name%"];
         }
         $platform_type = isset($this->post['platform_type']) && $this->post['platform_type'] !=="" ? intval($this->post['platform_type']):"";
         if($platform_type !=""){
-            $where[]=['platform_type',"=",$platform_type];
+            $where[]=['p.platform_type',"=",$platform_type];
         }
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status'])
             :"";
         if($status!==""){
-            $where[]=['status',"=",$status];
+            $where[]=['p.status',"=",$status];
         }
         $start = isset($this->post['start']) && $this->post['start']!=="" ? $this->post['start']:"";
         if($start!==""){
-            $where[]=['addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
+            $where[]=['p.addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
         }
         $end = isset($this->post['end']) && $this->post['end']!=="" ? $this->post['end']:"";
         if($end!==""){
-            $where[]=['addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
+            $where[]=['p.addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
         }
         $is_show=isset($this->post['is_show']) && $this->post['is_show']!=="" ? intval($this->post['is_show']):"1";
            if($is_show==1){
                $role=$this->checkRole();
                if(!empty($role['platform'])){
-                   $where[]=["id","in",$role['platform']];
+                   $where[]=["p.id","in",$role['platform']];
                }
            }
-        $count = Db::name('platform')->where($where)->count();
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["p.createrid", 'in', get_company_item_user_by_name($company_name)];
+
+        $count = Db::name('platform')->alias('p')->where($where)->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
-        $list = Db::name('platform')->where($where)->page($page,$size)->order("addtime desc")->select();
+        $list = Db::name('platform')
+            ->alias('p')
+            ->field('p.*,u.itemid')
+            ->leftJoin("depart_user u", "u.uid=p.createrid AND u.is_del=0")
+            ->where($where)
+            ->page($page,$size)
+            ->order("addtime desc")
+            ->append(['company_name'])
+            ->withAttr('company_name',function ($val,$data){
+                return implode('/', array_column(GetPart($data['itemid']), 'name'));
+            })
+            ->select()
+            ->toArray();
         return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
     }
     public function edit()

+ 37 - 21
app/admin/controller/Suppler.php

@@ -216,60 +216,76 @@ class Suppler extends BaseController
     public function list(){
         $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]];
+        $where =[['s.is_del',"=",0]];
         $name = isset($this->post['name']) && $this->post['name'] !=="" ? trim($this->post['name']):"";
         if($name !==""){
-            $where[]=["name","like","%$name%"];
+            $where[]=["s.name","like","%$name%"];
         }
         $creater = isset($this->post['creater']) && $this->post['creater'] !=="" ? trim($this->post['creater']):"";
         if($creater !==""){
-            $where[] = ["creater","like","%$creater%"];
+            $where[] = ["s.creater","like","%$creater%"];
         }
         $person = isset($this->post['person']) && $this->post['person'] !=="" ? trim($this->post['person']):"";
         if($person !==""){
-            $where[] = ["person","like","%$person%"];
+            $where[] = ["s.person","like","%$person%"];
         }
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']):"";
         if($status!==""){
-            $where[]= ["status","=",$status];
+            $where[]= ["s.status","=",$status];
         }
         $ocr_status = isset($this->post['ocr_status']) && $this->post['ocr_status'] !=="" ? intval($this->post['ocr_status']):"";
         if($ocr_status!==""){
-            $where[]= ["ocr_status","=",$ocr_status];
+            $where[]= ["s.ocr_status","=",$ocr_status];
         }
         $start = isset($this->post['start']) && $this->post['start'] !== "" ?  $this->post['start']:"";
         if($start!==""){
-            $where[]=['addtime',">=",$start];
+            $where[]=['s.addtime',">=",$start];
         }
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["s.createrid", 'in', get_company_item_user_by_name($company_name)];
+
 //        $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] :"";
 //        if($end !=""){
-//            $where[]=['a.addtime',"<=",$end];
+//            $where[]=['s.addtime',"<=",$end];
 //        }
 //        $contactor = isset($this->post['contactor']) && $this->post['contactor'] !==""? trim($this->post['contactor']):"";
 //        if($contactor !=""){
-//            $where[]=["contactor","like","%$contactor%"];
+//            $where[]=["s.contactor","like","%$contactor%"];
 //        }
 //        $mobile = isset($this->post['mobile']) && $this->post['mobile'] !=="" ? intval($this->post['mobile']):"";
 //        if($mobile !=""){
-//            $where[] = ['mobile',"like","%$mobile%"];
+//            $where[] = ['s.mobile',"like","%$mobile%"];
 //        }
-        $count = Db::name('supplier')->where($where)->count();
+        $count = Db::name('supplier')
+            ->alias('s')
+            ->where($where)
+            ->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
 //        $list = Db::name('supplier')->alias('a')
 //            ->join("supplier_contact b","b.code=a.code","left")
 //            ->where($where)->page($page,$size)->order("a.addtime desc")
 //            ->field("a.*,b.contactor,b.mobile")->select();
-        $list = Db::name('supplier')->where($where)->page($page,$size)->order("addtime desc")->select();
-       $var=[];
-        foreach ($list as $value){
-            $tem = Db::name('supplier_contact')->where(['code'=>$value['code']])->field("contactor,mobile")->find();
-            $iten=[];
-            $value['contactor']=$tem['contactor'];
-            $value['mobile']=$tem['mobile'];
-            $var[]=$value;
-        }
-        return app_show("0","获取成功",['list'=>$var,'count'=>$count]);
+        $list = Db::name('supplier')
+            ->alias('s')
+            ->field('s.*,u.itemid')
+            ->leftJoin("depart_user u", "u.uid=s.createrid AND u.is_del=0")
+            ->where($where)
+            ->page($page,$size)
+            ->order("addtime desc")
+            ->select()
+            ->toArray();
+
+        $all_codes = Db::name('supplier_contact')
+            ->whereIn('code', array_column($list, 'code'))
+            ->column("id,contactor,mobile",'code');
+
+        foreach ($list as &$value){
+            $value['contactor']=isset($all_codes[$value['code']]['contactor'])?$all_codes[$value['code']]['contactor']:'';
+            $value['mobile']=isset($all_codes[$value['code']]['mobile'])?$all_codes[$value['code']]['mobile']:'';
+            $value['company_name'] = implode('/', array_column(GetPart($value['itemid']), 'name'));
+        }
+        return app_show("0","获取成功",['list'=>$list,'count'=>$count]);
     }
     public function edit(){
         $token = isset($this->post['token'])&&$this->post['token']!='' ? trim($this->post['token']):"";

+ 22 - 4
app/admin/controller/Title.php

@@ -112,13 +112,31 @@ class Title extends BaseController
         if($end!==""){
             $where[]=['a.addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
         }
-        $count = Db::name('customer_title')->alias("a")
-            ->join("customer_info b","b.companyNo=a.companyNo","left")->where($where)->count();
+        $company_name = isset($this->post['company_name']) && $this->post['company_name'] !== "" ? trim($this->post['company_name']) : "";
+        if ($company_name !== "") $where[] = ["u.uid", 'in', get_company_item_user_by_name($company_name)];
+
+
+        $count = Db::name('customer_title')
+            ->alias("a")
+            ->join("customer_info b","b.companyNo=a.companyNo","left")
+            ->leftJoin("depart_user u", "u.nickname=b.creater AND u.is_del=0")
+            ->where($where)
+            ->count();
         $total = ceil($count / $size);
         $page = $page >= $total ? $total : $page;
-        $list = Db::name('customer_title')->alias("a")
+        $list = Db::name('customer_title')
+            ->alias("a")
+            ->field("a.*,b.companyName,b.creater,u.itemid")
             ->join("customer_info b","b.companyNo=a.companyNo","left")
-            ->where($where)->page($page,$size)->field("a.*,b.companyName,b.creater")->select();
+            ->leftJoin("depart_user u", "u.nickname=b.creater AND u.is_del=0")
+            ->where($where)
+            ->page($page,$size)
+            ->append(['company_name'])
+            ->withAttr('company_name',function ($val,$data){
+                return implode('/', array_column(GetPart($data['itemid']), 'name'));
+            })
+            ->select()
+            ->toArray();
         return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
     }
     public function edit(){

+ 19 - 6
app/admin/controller/WareHouse.php

@@ -188,14 +188,26 @@ class WareHouse extends BaseController
         }
         $page = isset($post['page']) &&$post['page']!=='' ?intval($post['page']) :1;
         $size = isset($post['size']) &&$post['size']!=='' ?intval($post['size']) :10;
-        $count = Db::name("warehouse_info")->alias("a")->join("warehouse_addr b ","a.wsm_code=b.wsm_code","left")
-            ->where($condition)->count();
+        $company_new_name = isset($post['company_new_name']) && $post['company_new_name'] !== "" ? trim($post['company_new_name']) : "";
+        if ($company_new_name !== "") $condition[] = ["a.contactor", 'in', get_company_item_user_by_name($company_new_name)];
+
+        $count = Db::name("warehouse_info")
+            ->alias("a")
+            ->join("warehouse_addr b ","a.wsm_code=b.wsm_code","left")
+            ->where($condition)
+            ->count();
         $page>=ceil($count/$size) ? $page = ceil($count/$size): '';
-        $list = Db::name("warehouse_info")->alias("a")->join("warehouse_addr b ","a.wsm_code=b.wsm_code","left")
-            ->where($condition)->field("a.id,a.wsm_code,a.name,a.wsm_type,a.supplierNo,a.addr,a.contactor,a.contactor_name,a.mobile,a.position,
-            a.status,a.addtime,a.companyNo,a.updatetime,a.wsm_type,b.wsm_name,b.wsm_mobile,b.wsm_addr,b.addr_code,a.addrs_code")->page($page,$size)
+        $list = Db::name("warehouse_info")
+            ->alias("a")
+            ->join("warehouse_addr b ","a.wsm_code=b.wsm_code","left")
+            ->leftJoin("depart_user u", "u.uid=a.contactor AND u.is_del=0")
+            ->where($condition)
+            ->field("a.id,a.wsm_code,a.name,a.wsm_type,a.supplierNo,a.addr,a.contactor,a.contactor_name,a.mobile,a.position,
+            a.status,a.addtime,a.companyNo,a.updatetime,a.wsm_type,b.wsm_name,b.wsm_mobile,b.wsm_addr,b.addr_code,a.addrs_code,u.itemid")
+            ->page($page,$size)
             ->order("a.addtime desc")
-            ->select();
+            ->select()
+            ->toArray();
         foreach ($list as $key=>$value){
             if($value['supplierNo']!=""){
                 $supplierinfo = Db::name("supplier")->where(["code"=>$value['supplierNo']])->find();
@@ -220,6 +232,7 @@ class WareHouse extends BaseController
 
             $value['addr_code'] = json_decode($value['addr_code'], true);
             $value['addrs_code'] = json_decode($value['addrs_code'], true);
+            $value['company_new_name'] = implode('/', array_column(GetPart($value['itemid']), 'name'));
             $list[$key]=$value;
 
         }