cqpCow 1 år sedan
förälder
incheckning
8e9e23089c
2 ändrade filer med 12 tillägg och 4 borttagningar
  1. 4 0
      app/Model/Customer.php
  2. 8 4
      app/Service/ImportService.php

+ 4 - 0
app/Model/Customer.php

@@ -18,6 +18,10 @@ class Customer extends UseScopeBaseModel
         'T9改装' => self::Model_type_one,
         'T9二手车' => self::Model_type_two
     ];
+    const dk2 = [
+        self::Model_type_one => 'T9改装',
+        self::Model_type_two => 'T9二手车',
+    ];
 
     public static $user = [];
     public static $search = [];

+ 8 - 4
app/Service/ImportService.php

@@ -252,7 +252,7 @@ class ImportService extends Service
 
         $model = BasicType::TopClear($user,[]);
         $basic = $model->where('del_time',0)
-            ->whereIn('type',[1,2,3,4,5,9,10])
+            ->whereIn('type',[1,2,3,4,5,9,10,30])
             ->select('id','title','type')
             ->get()
             ->toArray();
@@ -263,7 +263,9 @@ class ImportService extends Service
             }elseif ($value['type'] == 2){
                 $basic_list[3][$value['title']] = $value['id'];
             }elseif ($value['type'] == 3){
-                $basic_list[4][$value['title']] = $value['id'];
+                $basic_list[41][$value['title']] = $value['id'];
+            }elseif ($value['type'] == 30){
+                $basic_list[42][$value['title']] = $value['id'];
             }elseif ($value['type'] == 4){
                 $basic_list[12][$value['title']] = $value['id'];
             }elseif ($value['type'] == 5){
@@ -335,8 +337,10 @@ class ImportService extends Service
                 $tmp['customer_from'] = $basic_list[3][$value['3']];
             }
             if($value['4']){
-                if(empty($basic_list[4][$value['4']])) return [false, '客户类别:' . $value['4'] . '不存在'];
-                $tmp['customer_type'] = $basic_list[4][$value['4']];
+                $keys = 4 . $value[0];
+                $model_title = Customer::dk2[$value[0]] ?? "";
+                if(empty($basic_list[$keys][$value['4']])) return [false, '模板:' . $model_title . '下客户类别:' . $value['4'] . '不存在'];
+                $tmp['customer_type'] = $basic_list[$keys][$value['4']];
             }
             if($value['6']){
                 if(empty($product[$value['6']])) return [false, '意向产品:' . $value['6'] . '不存在'];