|
@@ -500,7 +500,7 @@ class CustomerService extends Service
|
|
|
public function customerList($data,$user){
|
|
|
$model = Customer::Clear($user,$data);
|
|
|
$model = $model->where('del_time',0)
|
|
|
- ->select('title','id','model_type','customer_intention','customer_from','customer_type','car_type','consulting_product','intention_product','progress_stage','address1','address2','crt_id','crt_time','mark','importance','company','company_short_name','depart_id','state_type','customer_state','pond_state','top_depart_id','fp_time')
|
|
|
+ ->select('title','id','model_type','customer_intention','customer_from','customer_type','car_type','consulting_product','intention_product','progress_stage','address1','address2','crt_id','crt_time','mark','importance','company','company_short_name','depart_id','state_type','customer_state','pond_state','top_depart_id','fp_time','fp_top_depart_id')
|
|
|
->orderby('id', 'desc');
|
|
|
|
|
|
if(! empty($data['my_fz']) || ! empty($data['my_xt'])){
|
|
@@ -575,7 +575,7 @@ class CustomerService extends Service
|
|
|
$model = Customer::Clear($user,$data);
|
|
|
$model = $model->where('del_time',0)
|
|
|
->where('fp_time','>',0)
|
|
|
- ->select('title','id','model_type','customer_intention','customer_from','customer_type','car_type','consulting_product','intention_product','progress_stage','address1','address2','crt_id','crt_time','mark','importance','company','company_short_name','depart_id','state_type','customer_state','pond_state','top_depart_id','fp_time')
|
|
|
+ ->select('title','id','model_type','customer_intention','customer_from','customer_type','car_type','consulting_product','intention_product','progress_stage','address1','address2','crt_id','crt_time','mark','importance','company','company_short_name','depart_id','state_type','customer_state','pond_state','top_depart_id','fp_time','fp_top_depart_id')
|
|
|
->orderby('id', 'desc')
|
|
|
->orderby('fp_time', 'desc');
|
|
|
|
|
@@ -812,6 +812,9 @@ class CustomerService extends Service
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $array2 = array_unique(array_merge_recursive(array_column($data['data'],'top_depart_id'),array_column($data['data'],'fp_top_depart_id')));
|
|
|
+ $depart = Depart::whereIn('id',$array2)->pluck('title','id')->toArray();
|
|
|
+
|
|
|
$address_map = config('address');
|
|
|
foreach ($data['data'] as $key => $value){
|
|
|
$address_str = [];
|
|
@@ -845,6 +848,8 @@ class CustomerService extends Service
|
|
|
$data['data'][$key]['has_record'] = $record_tmp ? "查看" : "无记录";
|
|
|
$data['data'][$key]['follow_record'] = $record_array[$value['id']] ?? "";
|
|
|
$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']] ?? "";
|
|
|
}
|
|
|
|
|
|
return $data;
|