Ver Fonte

客户名称能重复上线

cqp há 2 meses atrás
pai
commit
ea1e0fab29
2 ficheiros alterados com 14 adições e 14 exclusões
  1. 12 12
      app/Service/CustomerService.php
  2. 2 2
      app/Service/ImportService.php

+ 12 - 12
app/Service/CustomerService.php

@@ -1009,11 +1009,11 @@ class CustomerService extends Service
 
 
         if($is_add){
-            $bool = Customer::where('del_time',0)
-                ->where('top_depart_id',$data['top_depart_id'])
-                ->where('title',$data['title'])
-//                ->where('model_type',$data['model_type'])
-                ->exists();
+//            $bool = Customer::where('del_time',0)
+//                ->where('top_depart_id',$data['top_depart_id'])
+//                ->where('title',$data['title'])
+////                ->where('model_type',$data['model_type'])
+//                ->exists();
             if(! empty($data['customer_contact'])) {
                 $search = [];
                 foreach ($data['customer_contact'] as $value){
@@ -1030,12 +1030,12 @@ class CustomerService extends Service
             }
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
-            $bool = Customer::where('del_time',0)
-                ->where('id','<>',$data['id'])
-                ->where('top_depart_id',$data['top_depart_id'])
-                ->where('title',$data['title'])
-//                ->where('model_type',$data['model_type'])
-                ->exists();
+//            $bool = Customer::where('del_time',0)
+//                ->where('id','<>',$data['id'])
+//                ->where('top_depart_id',$data['top_depart_id'])
+//                ->where('title',$data['title'])
+////                ->where('model_type',$data['model_type'])
+//                ->exists();
 
             if(! empty($data['customer_contact'])) {
                 $search = [];
@@ -1053,7 +1053,7 @@ class CustomerService extends Service
                 if($boolean) return [false,'客户联系内容已存在'];
             }
         }
-        if($bool) return [false,'客户名称不能重复'];
+//        if($bool) return [false,'客户名称不能重复'];
 
         return [true, ''];
     }

+ 2 - 2
app/Service/ImportService.php

@@ -561,8 +561,8 @@ class ImportService extends Service
             $repeat = 0;//是否重复
 
             if(! empty($customer[$value['1']])) {
-                $error[] = $line . '客户名称:' . $value['1'] . '已存在';
-                $repeat = 1;
+//                $error[] = $line . '客户名称:' . $value['1'] . '已存在';
+//                $repeat = 1;
             }else{
                 $tmp['title'] = $value['1'];
             }