cqpCow hai 1 ano
pai
achega
43aa25de51
Modificáronse 2 ficheiros con 6 adicións e 4 borrados
  1. 1 0
      app/Model/BasicType.php
  2. 5 4
      app/Service/FollowUpRecordService.php

+ 1 - 0
app/Model/BasicType.php

@@ -32,5 +32,6 @@ class BasicType extends Model
         18 => '安装方式',
         19 => '紧急程度',
         20 => '产品单位',
+        21 => '跟进方式',
     ];
 }

+ 5 - 4
app/Service/FollowUpRecordService.php

@@ -21,7 +21,8 @@ class FollowUpRecordService extends Service
         $model->basic_type_id = $data['basic_type_id'] ;
         $model->visit_time = $data['visit_time'];
         $model->content = $data['content'];
-        $model->is_remind = $data['is_remind'];
+        $model->is_remind = $data['is_remind'] ?? 0;
+        $model->result = $data['result'] ?? '';
         $model->save();
 
         return [true,''];
@@ -37,8 +38,9 @@ class FollowUpRecordService extends Service
         $model->basic_type_id = $data['basic_type_id'] ;
         $model->visit_time = $data['visit_time'];
         $model->content = $data['content'];
-        $model->is_remind = $data['is_remind'];
+        $model->is_remind = $data['is_remind'] ?? 0;
         $model->crt_id = $user['id'];
+        $model->result = $data['result'] ?? '';
         $model->save();
 
         return [true,''];
@@ -56,7 +58,7 @@ class FollowUpRecordService extends Service
 
     public function followUpRecordList($data,$user){
         $model = FollowUpRecord::where('del_time',0)
-            ->select('customer_id','basic_type_id','visit_time','id','content','is_remind','crt_time','crt_id','sales_order_id')
+            ->select('customer_id','basic_type_id','visit_time','id','content','is_remind','crt_time','crt_id','sales_order_id','result')
             ->orderBy('id','desc');
 
         if(! empty($data['customer_id'])) $model->where('customer_id',$data['customer_id']);
@@ -95,7 +97,6 @@ class FollowUpRecordService extends Service
         if($this->isEmpty($data,'basic_type_id')) return [false,'跟进方式不能为空'];
         if($this->isEmpty($data,'visit_time')) return [false,'拜访时间不能为空'];
         if($this->isEmpty($data,'content')) return [false,'跟进内容不能为空'];
-        if($this->isEmpty($data,'sales_order_id')) return [false,'请选择合同'];
 
         if(! $is_add){
             if($this->isEmpty($data,'id')) return [false,'ID不能为空!'];