|
@@ -812,12 +812,12 @@ class CustomerService extends Service
|
|
|
|
|
|
$customer_info = CustomerInfo::where('del_time',0)
|
|
|
->whereIn('customer_id',array_column($data['data'],'id'))
|
|
|
- ->whereIn('type',[CustomerInfo::type_one,CustomerInfo::type_two])
|
|
|
+ ->whereIn('type',[CustomerInfo::type_one,CustomerInfo::type_two,CustomerInfo::type_three])
|
|
|
->select('type','contact_type','contact_info','customer_id','data_id')
|
|
|
->get()->toArray();
|
|
|
|
|
|
- //客户的联系方式 客户的负责人
|
|
|
- $customer_info_map = $fz = $customer_info_map2 = [];
|
|
|
+ //客户的联系方式 客户的负责人 协同人
|
|
|
+ $customer_info_map = $fz = $customer_info_map2 = $xt = [];
|
|
|
$emp_map = Employee::whereIn('id',array_filter(array_column($customer_info,'data_id')))
|
|
|
->pluck('emp_name','id')
|
|
|
->toArray();
|
|
@@ -831,13 +831,20 @@ class CustomerService extends Service
|
|
|
}else{
|
|
|
$customer_info_map2[$value['customer_id']] .= ',' . $value['contact_type_title'] . ": " . $value['contact_info'];
|
|
|
}
|
|
|
- }else{
|
|
|
+ }elseif($value['type'] == CustomerInfo::type_two){
|
|
|
$tmp = $emp_map[$value['data_id']] ?? "";
|
|
|
if(isset($fz[$value['customer_id']])){
|
|
|
$fz[$value['customer_id']] .= ',' . $tmp;
|
|
|
}else{
|
|
|
$fz[$value['customer_id']] = $tmp;
|
|
|
}
|
|
|
+ }else{
|
|
|
+ $tmp = $emp_map[$value['data_id']] ?? "";
|
|
|
+ if(isset($xt[$value['customer_id']])){
|
|
|
+ $xt[$value['customer_id']] .= ',' . $tmp;
|
|
|
+ }else{
|
|
|
+ $xt[$value['customer_id']] = $tmp;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -879,6 +886,7 @@ class CustomerService extends Service
|
|
|
$data['data'][$key]['order_number'] = Customer::$order_number . "|" . $value['id'] . "|" . $value['title'];
|
|
|
$data['data'][$key]['top_depart_title'] = $depart[$value['top_depart_id']] ?? "";
|
|
|
$data['data'][$key]['fp_top_depart_title'] = $depart[$value['fp_top_depart_id']] ?? "";
|
|
|
+ $data['data'][$key]['xt'] = $xt[$value['id']] ?? "";
|
|
|
}
|
|
|
|
|
|
return $data;
|