wugg 2 years ago
parent
commit
903fa8ecdc
1 changed files with 12 additions and 7 deletions
  1. 12 7
      app/admin/controller/Consult.php

+ 12 - 7
app/admin/controller/Consult.php

@@ -2405,15 +2405,20 @@ class Consult extends Base
         if ($status !== "") {
             $where[]= ["a.status",'=',$status];
         }
-
+        $userCommon=new \app\admin\common\User();
         //查看非本公司的竞价单
         $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo']!="" ? trim($this->post['relaComNo']):"";
-        if($this->level!=1 & $relaComNo!="") $where[]=['b.companyNo','<>', $relaComNo];
+        if($this->level!=1 & $relaComNo!="") {
+        	$companyNo='';
+        	$relaComArr=$userCommon->handle("hqInfo",["code"=>$relaComNo]);
+        	if(isset($relaComArr['code'])&&$relaComArr['code']==0&& empty($relaComArr['data'])) {
+        		$companyNo = $this->level==2?$relaComArr['data']['relation_code'] :$relaComArr['data']['code'];
+        	}
+        	$where[]=['b.companyNo','<>', $companyNo];
+        }
+
+
 
-//        $role=$this->checkRole();
-//        if(!empty($role['platform']) ){
-//            $where[]=["b.platform_code","in",$role['platform']];
-//        }
         $count = Db::name('consult_info')
             ->alias("a")
             ->leftJoin("consult_order b","a.zxNo=b.zxNo")
@@ -2435,7 +2440,7 @@ class Consult extends Base
             ->whereIn('id',array_column($list,'brand_id'))
             ->column('brand_name','id');
 
-        $userCommon=new \app\admin\common\User();
+
         $names = $userCommon->handle('getCodeAndName',['code'=>array_unique(array_merge(array_column($list,'khNo'),array_column($list,'companyNo')))]);
 
         foreach ($list as $value){