|
@@ -177,28 +177,19 @@ class FollowUpRecordService extends Service
|
|
|
public function followUpRecordDetail($data){
|
|
|
if($this->isEmpty($data,'id')) return [false,'ID必须!'];
|
|
|
|
|
|
- $record = FollowUpRecord::where('del_time',0)
|
|
|
- ->where('id',$data['id'])
|
|
|
- ->first();
|
|
|
- if(empty($record)) return [false,'跟进记录不存在或已被删除'];
|
|
|
- $record = $record->toArray();
|
|
|
- $record['file'] = [];
|
|
|
+ $record = [];
|
|
|
$sales_info = FollowUpRecordFile::where('del_time',0)
|
|
|
->where('follow_up_record_id',$data['id'])
|
|
|
->get()->toArray();
|
|
|
foreach ($sales_info as $value){
|
|
|
if ($value['type'] == FollowUpRecordFile::type_one){
|
|
|
- $record['file'][] = [
|
|
|
+ $record[] = [
|
|
|
'url' => $value['file'],
|
|
|
'name' => $value['name'],
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $emp_map = Employee::where('id',$record['crt_id'])->value('emp_name');
|
|
|
- $record['crt_name'] = $emp_map;
|
|
|
- $record['crt_time'] = $record['crt_time'] ? date("Y-m-d H:i:s",$record['crt_time']): '';
|
|
|
-
|
|
|
return [true, $record];
|
|
|
}
|
|
|
}
|