cqp 1 месяц назад
Родитель
Сommit
aa52aaec65
1 измененных файлов с 2 добавлено и 9 удалено
  1. 2 9
      app/Service/CustomerSupplyService.php

+ 2 - 9
app/Service/CustomerSupplyService.php

@@ -276,7 +276,6 @@ class CustomerSupplyService extends Service
     }
 
     public function customerSupplyRule(&$data, $user, $is_add = true){
-        if(empty($data['code'])) return [false, '编码不能为空'];
         if(empty($data['title'])) return [false, '名称不能为空'];
         if(empty($data['type'])) return [false, '人员类型不能为空'];
         if(! isset(CustomerSupply::$type_name[$data['type']])) return [false, '人员类型错误'];
@@ -287,19 +286,13 @@ class CustomerSupplyService extends Service
         if(! $status) return [false, $msg];
 
         if($is_add){
-            $bool = CustomerSupply::where('code',$data['code'])
-                ->where('crt_id', $user['id'])
-                ->where('del_time',0)
-                ->exists();
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
-            $bool = CustomerSupply::where('code',$data['code'])
-                ->where('crt_id', $user['id'])
-                ->where('id','<>',$data['id'])
+            $bool = CustomerSupply::where('id',$data['id'])
                 ->where('del_time',0)
                 ->exists();
+            if($bool) return [false, '人员不存在或已被删除'];
         }
-        if($bool) return [false, '编码已存在'];
 
         return [true, $data];
     }