cqpCow 1 år sedan
förälder
incheckning
eab6fb8751
1 ändrade filer med 8 tillägg och 1 borttagningar
  1. 8 1
      app/Service/ConstructionService.php

+ 8 - 1
app/Service/ConstructionService.php

@@ -29,6 +29,7 @@ class ConstructionService extends Service
             $model->install_position = $data['install_position'] ?? '';
             $model->sales_order_id = $data['sales_order_id'] ?? 0;
             $model->construction_fee = $data['construction_fee'] ?? 0;
+            $model->service_price = $data['service_price'] ?? 0;
             $model->construction_time = $data['construction_time'] ?? 0;
             $model->handover_time = $data['handover_time'] ?? 0;
             $model->urgency = $data['urgency'] ?? 0;
@@ -116,6 +117,7 @@ class ConstructionService extends Service
             $model->install_position = $data['install_position'] ?? '';
             $model->sales_order_id = $data['sales_order_id'] ?? 0;
             $model->construction_fee = $data['construction_fee'] ?? 0;
+            $model->service_price = $data['service_price'] ?? 0;
             $model->construction_time = $data['construction_time'] ?? 0;
             $model->handover_time = $data['handover_time'] ?? 0;
             $model->urgency = $data['urgency'] ?? 0;
@@ -280,7 +282,7 @@ class ConstructionService extends Service
     public function constructionList($data,$user){
         $model = new Construction(['userData' => $user]);
         $model = $model->where('del_time',0)
-            ->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')
+            ->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')
             ->where('model_type',$data['model_type']);
 
@@ -313,6 +315,11 @@ class ConstructionService extends Service
             $res = $this->checkNumber($data['construction_fee']);
             if(! $res) return [false,'施工费用请输入不超过两位小数并且大于0的数值'];
         }
+        if(! empty($data['service_price'])){
+            $res = $this->checkNumber($data['service_price']);
+            if(! $res) return [false,'服务价格请输入不超过两位小数并且大于0的数值'];
+        }
+
         if($data['model_type'] == Construction::Model_type_one){
             if(empty($data['install_method'])) return [false,'安装方式不能为空'];
             if(empty($data['install_position'])) return [false,'安装地点不能为空'];