cqpCow 1 year ago
parent
commit
a58ea139e0
2 changed files with 10 additions and 5 deletions
  1. 3 1
      app/Model/SalesOrder.php
  2. 7 4
      app/Service/SalesOrderService.php

+ 3 - 1
app/Model/SalesOrder.php

@@ -81,6 +81,8 @@ class SalesOrder extends UseScopeBaseModel
         self::Model_type_one => 'T9XX.',
         self::Model_type_two => 'T9SO.',
         self::Model_type_three => 'T9XX.',
-        self::Model_type_four => 'T9XS.'
+        self::Model_type_four => 'T9XS.',
+        self::Model_type_five => 'T9XX.',
+        self::Model_type_six => 'T9XX.',
     ];
 }

+ 7 - 4
app/Service/SalesOrderService.php

@@ -54,6 +54,8 @@ class SalesOrderService extends Service
             $model->order_type = $data['order_type'] ?? 0;
             $model->install_method = $data['install_method'] ?? 0;
             $model->install_position = $data['install_position'] ?? 0;
+            $model->customer_id = $data['customer_id'] ?? 0;
+            $model->customer_contact = $data['customer_contact'] ?? "";
             $model->sign_time = $data['sign_time'] ?? 0;
             $model->product_total = $data['product_total'] ?? 0;
             $model->rate = $data['rate'] ?? 0;
@@ -201,6 +203,7 @@ class SalesOrderService extends Service
             $model->install_method = $data['install_method'] ?? 0;
             $model->install_position = $data['install_position'] ?? 0;
             $model->customer_id = $data['customer_id'] ?? 0;
+            $model->customer_contact = $data['customer_contact'] ?? "";
             $model->sign_time = $data['sign_time'] ?? 0;
             $model->product_total = $data['product_total'] ?? 0;
             $model->rate = $data['rate'] ?? 0;
@@ -525,7 +528,7 @@ class SalesOrderService extends Service
     public function salesOrderList($data,$user){
         $model = SalesOrder::Clear($user,$data);
         $model = $model->where('del_time',0)
-            ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position')
+            ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact')
             ->orderby('id', 'desc');
 
         if(! empty($data['order_number'])) $model->where('order_number','LIKE', '%'.$data['order_number'].'%');
@@ -785,8 +788,8 @@ class SalesOrderService extends Service
     }
 
     public function salesOrderGet($data){
-        if(empty($data['model_type'])) return [false,'订单模板类型不能为空'];
-        if(! isset(SalesOrder::$prefix[$data['model_type']])) return [false,'订单模板类型错误'];
+        if(empty($data['model_type'])) return [false,'销售类型不能为空'];
+        if(! isset(SalesOrder::$prefix[$data['model_type']])) return [false,'销售类型错误'];
         $prefix = SalesOrder::$prefix[$data['model_type']];
         $order_number = OrderNoService::createSalesOrderNumber($prefix);
         if(! $order_number) return [false,'合同编号生成失败!'];
@@ -1019,7 +1022,7 @@ class SalesOrderService extends Service
 
     public function salesOrderListsalesOrderWxList($data,$user){
         $model = SalesOrder::where('del_time',0)
-            ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position')
+            ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact')
             ->orderby('id', 'desc');
 
         if(! empty($data['openid'])){