|
@@ -27,7 +27,7 @@ class BusinessOpportunityService extends Service
|
|
|
$model->address1 = ! empty($data['address1']) ? json_encode($data['address1']) : '';
|
|
|
$model->address2 = $data['address2'] ?? '';
|
|
|
$model->mark = $data['mark'] ?? '';
|
|
|
- $model->intention = $data['intention'] ?? '';
|
|
|
+ $model->intention = $data['intention'] ?? 0;
|
|
|
$model->customer_type = $data['customer_type'] ?? '';
|
|
|
$model->save();
|
|
|
$time = time();
|
|
@@ -123,7 +123,7 @@ class BusinessOpportunityService extends Service
|
|
|
$model->address1 = ! empty($data['address1']) ? json_encode($data['address1']) : '';
|
|
|
$model->address2 = $data['address2'] ?? '';
|
|
|
$model->mark = $data['mark'] ?? '';
|
|
|
- $model->intention = $data['intention'] ?? '';
|
|
|
+ $model->intention = $data['intention'] ?? 0;
|
|
|
$model->customer_type = $data['customer_type'] ?? '';
|
|
|
$model->crt_id = $user['id'];
|
|
|
$model->save();
|
|
@@ -257,6 +257,7 @@ class BusinessOpportunityService extends Service
|
|
|
$tmp = [
|
|
|
'id' => $value['contact_type'],
|
|
|
'type' => $value['contact_type'],
|
|
|
+ 'type_title' => BusinessOpportunityInfo::$contact_type[$value['contact_type']] ?? "",
|
|
|
'info' => $value['contact_info']
|
|
|
];
|
|
|
$customer['customer_contact'][] = $tmp;
|
|
@@ -305,7 +306,7 @@ class BusinessOpportunityService extends Service
|
|
|
}
|
|
|
}
|
|
|
if(! empty($data['mark'])) $model->where('mark','LIKE', '%'.$data['mark'].'%');
|
|
|
- if(! empty($data['intention'])) $model->where('intention',$data['intention']);
|
|
|
+ if(isset($data['intention'])) $model->where('intention',$data['intention']);
|
|
|
if(! empty($data['crt_time'][0]) && ! empty($data['crt_time'][1])) {
|
|
|
$return = $this->changeDateToTimeStampAboutRange($data['crt_time']);
|
|
|
$model->where('crt_time','>=',$return[0]);
|
|
@@ -351,12 +352,13 @@ class BusinessOpportunityService extends Service
|
|
|
$customer_info = BusinessOpportunityInfo::where('del_time',0)
|
|
|
->whereIn('business_opportunity_id',array_column($data['data'],'id'))
|
|
|
->whereIn('type',[BusinessOpportunityInfo::type_one])
|
|
|
- ->select('type','contact_type','contact_info','customer_id','data_id')
|
|
|
+ ->select('contact_type as type','contact_info as info','customer_id','data_id')
|
|
|
->get()->toArray();
|
|
|
|
|
|
//联系方式
|
|
|
$customer_info_map = [];
|
|
|
foreach ($customer_info as $value){
|
|
|
+ $value['type_title'] = BusinessOpportunityInfo::$contact_type[$value['type']] ?? "";
|
|
|
$customer_info_map[$value['customer_id']][] = $value;
|
|
|
}
|
|
|
|
|
@@ -373,7 +375,7 @@ class BusinessOpportunityService extends Service
|
|
|
$address = $value['address2'];
|
|
|
}
|
|
|
$data['data'][$key]['address'] = $address;
|
|
|
- $data['data'][$key]['is_company_title'] = $value['customer_intention'] ? '是' : '否';
|
|
|
+ $data['data'][$key]['is_company_title'] = $value['is_company'] ? '是' : '否';
|
|
|
$data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
|
|
|
$data['data'][$key]['crt_name'] = $emp[$value['crt_id']] ?? '';
|
|
|
$record_tmp = $record_array[$value['id']] ?? "";
|