|
@@ -283,7 +283,7 @@ class CustomerService extends Service
|
|
|
if(empty($customer)) return [false,'客户不存在或已被删除'];
|
|
|
$customer = $customer->toArray();
|
|
|
if(! empty($customer['address1'])) $customer['address1'] = json_decode($customer['address1'],true);
|
|
|
- $customer['customer_contact'] = $customer['employee_one'] = $customer['employee_two'] = $customer['employee_three'] = $customer['img'] = $customer['file'] =[];
|
|
|
+ $customer['customer_contact'] = $customer['employee_one'] = $customer['employee_two'] = $customer['employee_three'] = $customer['img'] = $customer['file'] = [];
|
|
|
$array = [
|
|
|
$customer['customer_intention'],
|
|
|
$customer['customer_from'],
|
|
@@ -298,7 +298,8 @@ class CustomerService extends Service
|
|
|
$basic_map = BasicType::whereIn('id',$array)
|
|
|
->pluck('title','id')
|
|
|
->toArray();
|
|
|
- $depart_title = Depart::where('id',$customer['depart_id'])->select('title')->value();
|
|
|
+ $depart_title = Depart::where('id',$customer['depart_id'])->select('title')->value('title');
|
|
|
+ $customer = [$customer];
|
|
|
foreach ($customer as $key => $value){
|
|
|
$customer[$key]['customer_intention_title'] = $basic_map[$value['customer_intention']] ?? '';
|
|
|
$customer[$key]['customer_from_title'] = $basic_map[$value['customer_from']] ?? '';
|
|
@@ -311,6 +312,7 @@ class CustomerService extends Service
|
|
|
$customer[$key]['customer_grade_title'] = $basic_map[$value['customer_grade']] ?? '';
|
|
|
$customer[$key]['depart_title'] = $depart_title ?? '';
|
|
|
}
|
|
|
+ $customer = $customer[0];
|
|
|
|
|
|
$customer_info = CustomerInfo::where('del_time',0)
|
|
|
->where('customer_id',$customer['id'])
|
|
@@ -336,7 +338,7 @@ class CustomerService extends Service
|
|
|
];
|
|
|
}elseif ($value['type'] == CustomerInfo::type_five){
|
|
|
$customer['img'][] = [
|
|
|
- $value['employee_id']
|
|
|
+ $value['file']
|
|
|
];
|
|
|
}elseif ($value['type'] == CustomerInfo::type_six){
|
|
|
$customer['file'][] = [
|