cqpCow 1 سال پیش
والد
کامیت
b8b395ba1b
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      app/Service/CustomerService.php

+ 8 - 0
app/Service/CustomerService.php

@@ -516,6 +516,14 @@ class CustomerService extends Service
             $id = (new FollowUpRecordService())->getLastVisitData($data['last_visit_time']);
             $model->whereIn('id',$id);
         }
+        if(! empty($data['contact_info'])){
+            $customer_info = CustomerInfo::where('del_time',0)
+                ->where("type",CustomerInfo::type_one)
+                ->where('contact_info','LIKE', '%'.$data['contact_info'].'%')
+                ->select('customer_id')
+                ->get()->toArray();
+            $model->whereIn('id',array_column($customer_info,'customer_id'));
+        }
 
         $list = $this->limit($model,'',$data);
         $list = $this->fillData($list,$data);