|
@@ -103,8 +103,9 @@ class CustomerService extends Service
|
|
foreach ($data['img'] as $value){
|
|
foreach ($data['img'] as $value){
|
|
$insert[] = [
|
|
$insert[] = [
|
|
'customer_id' => $model->id,
|
|
'customer_id' => $model->id,
|
|
- 'file' => $value,
|
|
|
|
|
|
+ 'file' => $value['url'],
|
|
'type' => CustomerInfo::type_five,
|
|
'type' => CustomerInfo::type_five,
|
|
|
|
+ 'name' => $value['name'],
|
|
'crt_time' => $time,
|
|
'crt_time' => $time,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -116,8 +117,9 @@ class CustomerService extends Service
|
|
foreach ($data['file'] as $value){
|
|
foreach ($data['file'] as $value){
|
|
$insert[] = [
|
|
$insert[] = [
|
|
'customer_id' => $model->id,
|
|
'customer_id' => $model->id,
|
|
- 'file' => $value,
|
|
|
|
|
|
+ 'file' => $value['url'],
|
|
'type' => CustomerInfo::type_six,
|
|
'type' => CustomerInfo::type_six,
|
|
|
|
+ 'name' => $value['name'],
|
|
'crt_time' => $time,
|
|
'crt_time' => $time,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -222,8 +224,9 @@ class CustomerService extends Service
|
|
foreach ($data['img'] as $value){
|
|
foreach ($data['img'] as $value){
|
|
$insert[] = [
|
|
$insert[] = [
|
|
'customer_id' => $model->id,
|
|
'customer_id' => $model->id,
|
|
- 'file' => $value,
|
|
|
|
|
|
+ 'file' => $value['url'],
|
|
'type' => CustomerInfo::type_five,
|
|
'type' => CustomerInfo::type_five,
|
|
|
|
+ 'name' => $value['name'],
|
|
'crt_time' => $time,
|
|
'crt_time' => $time,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -235,8 +238,9 @@ class CustomerService extends Service
|
|
foreach ($data['file'] as $value){
|
|
foreach ($data['file'] as $value){
|
|
$insert[] = [
|
|
$insert[] = [
|
|
'customer_id' => $model->id,
|
|
'customer_id' => $model->id,
|
|
- 'file' => $value,
|
|
|
|
|
|
+ 'file' => $value['url'],
|
|
'type' => CustomerInfo::type_six,
|
|
'type' => CustomerInfo::type_six,
|
|
|
|
+ 'name' => $value['name'],
|
|
'crt_time' => $time,
|
|
'crt_time' => $time,
|
|
];
|
|
];
|
|
}
|
|
}
|
|
@@ -285,6 +289,7 @@ class CustomerService extends Service
|
|
$address = '';
|
|
$address = '';
|
|
if(! empty($customer['address1'])) {
|
|
if(! empty($customer['address1'])) {
|
|
$tmp = json_decode($customer['address1'],true);
|
|
$tmp = json_decode($customer['address1'],true);
|
|
|
|
+ $customer['address1'] = $tmp;
|
|
$tmp = implode(' ',$tmp);
|
|
$tmp = implode(' ',$tmp);
|
|
$tmp .= ' ' . $customer['address2'];
|
|
$tmp .= ' ' . $customer['address2'];
|
|
$address = $tmp;
|
|
$address = $tmp;
|
|
@@ -323,7 +328,7 @@ class CustomerService extends Service
|
|
|
|
|
|
$customer_info = CustomerInfo::where('del_time',0)
|
|
$customer_info = CustomerInfo::where('del_time',0)
|
|
->where('customer_id',$customer['id'])
|
|
->where('customer_id',$customer['id'])
|
|
- ->select('id','customer_id','contact_type','contact_info','employee_id','file','type')
|
|
|
|
|
|
+ ->select('id','customer_id','contact_type','contact_info','employee_id','file','type','name')
|
|
->get()->toArray();
|
|
->get()->toArray();
|
|
$emp_map = Employee::whereIn('id',array_unique(array_merge_recursive([$customer['crt_id']],array_column($customer_info,'employee_id'))))
|
|
$emp_map = Employee::whereIn('id',array_unique(array_merge_recursive([$customer['crt_id']],array_column($customer_info,'employee_id'))))
|
|
->pluck('emp_name','id')
|
|
->pluck('emp_name','id')
|
|
@@ -358,9 +363,17 @@ class CustomerService extends Service
|
|
];
|
|
];
|
|
$customer['employee_three'][] = $tmp;
|
|
$customer['employee_three'][] = $tmp;
|
|
}elseif ($value['type'] == CustomerInfo::type_five){
|
|
}elseif ($value['type'] == CustomerInfo::type_five){
|
|
- $customer['img'][] = $value['file'];
|
|
|
|
|
|
+ $tmp = [
|
|
|
|
+ 'url' => $value['file'],
|
|
|
|
+ 'name' => $value['name'],
|
|
|
|
+ ];
|
|
|
|
+ $customer['img'][] = $tmp;
|
|
}elseif ($value['type'] == CustomerInfo::type_six){
|
|
}elseif ($value['type'] == CustomerInfo::type_six){
|
|
- $customer['file'][] = $value['employee_id'];
|
|
|
|
|
|
+ $tmp = [
|
|
|
|
+ 'url' => $value['file'],
|
|
|
|
+ 'name' => $value['name'],
|
|
|
|
+ ];
|
|
|
|
+ $customer['file'][] = $tmp;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$customer['crt_name'] = $emp_map[$customer['crt_id']] ?? '';
|
|
$customer['crt_name'] = $emp_map[$customer['crt_id']] ?? '';
|