cqpCow 1 year ago
parent
commit
9c54eb1b5a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      app/Service/ConstructionService.php

+ 10 - 0
app/Service/ConstructionService.php

@@ -348,6 +348,16 @@ class ConstructionService extends Service
             ->select('title','id','model_type','order_number','customer_id','customer_contact_id','install_method','install_position','sales_order_id','construction_fee','construction_time','handover_time','urgency','crt_id','crt_time','mark','state','address1','address2','introduction','service_price')
             ->orderby('id', 'desc');
 
+        if($user['id'] != Employee::SPECIAL_ADMIN){
+            //单据中选择的签订负责协同人
+            $construction_id = ConstructionInfo::where('del_time',0)
+                ->where('employee_id',$user['id'])
+                ->select('construction_id')
+                ->get()->toArray();
+            $construction_id = array_unique(array_column($construction_id,'construction_id'));
+            //可见范围
+            $model->whereIn('id', $construction_id);
+        }
         if(! empty($data['title'])) $model->where('title', 'LIKE', '%'.$data['title'].'%');
         if(! empty($data['model_type'])) $model->where('model_type',$data['model_type']);
         $list = $this->limit($model,'',$data);