Merge branch 'feature/mzl_dev'
This commit is contained in:
@@ -100,7 +100,7 @@ class InquiryLogService
|
||||
$config['with']['countryInfo'][] = 'cn_addr';
|
||||
$config['with']['countryInfo'][] = 'steering';
|
||||
$config['with']['enter'][] = 'name';
|
||||
$config['with']['recipient'][] = 'name';
|
||||
$config['with']['recipientInfo'][] = 'name';
|
||||
$config['with']['channelInfo'][] = 'name';
|
||||
break;
|
||||
case 'show':
|
||||
@@ -215,7 +215,7 @@ class InquiryLogService
|
||||
$config['with']['countryInfo'][] = 'cn_addr';
|
||||
$config['with']['countryInfo'][] = 'steering';
|
||||
$config['with']['enter'][] = 'name';
|
||||
$config['with']['recipient'][] = 'name';
|
||||
$config['with']['recipientInfo'][] = 'name';
|
||||
$config['with']['channelInfo'][] = 'name';
|
||||
$config['orWhere'][] = ['id', '=', $id];
|
||||
$config['orWhere'][] = ['order_no', '=', $id];
|
||||
@@ -239,4 +239,37 @@ class InquiryLogService
|
||||
];
|
||||
return $quality[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内容(发送邮箱用)
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getContent(int $id)
|
||||
{
|
||||
$relation = ['enter', 'recipientInfo', 'channelInfo', 'countryInfo'];
|
||||
$info = InquiryLog::with($relation)->find($id);
|
||||
|
||||
$enterName = $info->enter ? $info->enter->name : ' - ';
|
||||
$recipientName = $info->recipientInfo ? $info->recipientInfo->name : ' - ';
|
||||
$channelName = $info->channelInfo ? $info->channelInfo->name : ' - ';
|
||||
$countryName = $info->countryInfo ? $info->countryInfo->cn_addr : ' - ';
|
||||
|
||||
$data = [
|
||||
'order_no' => $info->order_no && $info->order_no != '' ? $info->order_no : ' - ',
|
||||
'enter_user_id' => $enterName,
|
||||
'recipient' => $recipientName,
|
||||
'quality' => (new \app\inquiry\service\InquiryLogService())->qualityName($info->quality),
|
||||
'channel' => $channelName,
|
||||
'email' => $info->email && $info->email != '' ? $info->email : ' - ',
|
||||
'tel' => $info->tel && $info->tel != '' ? $info->tel : ' - ',
|
||||
'whatsapp' => $info->whatsapp && $info->whatsapp != '' ? $info->whatsapp : ' - ',
|
||||
'country' => $countryName,
|
||||
'contacts' => $info->contacts && $info->contacts != '' ? $info->contacts : ' - ',
|
||||
'content' => $info->content && $info->content != '' ? $info->content : ' - ',
|
||||
'r_time' => $info->r_time ? date('Y-m-d H:i:s', $info->r_time) : ' - ',
|
||||
't_time' => $info->t_time ? date('Y-m-d H:i:s', $info->t_time) : ' - '
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user