询单推送到crm优化

This commit is contained in:
2025-08-25 18:17:14 +08:00
parent 7b280afd72
commit 958f4448d6
3 changed files with 14 additions and 5 deletions
+4 -1
View File
@@ -41,7 +41,7 @@ class InquiryToCrm implements Consumer
// 同步客户数据
$crmCustomer = new CrmCustomer();
$crmCustomer->sn = $info->order_no;
$crmCustomer->corp_abbr = $corpId;
$crmCustomer->corp_id = $corpId;
$crmCustomer->user_id = $recipient;
$crmCustomer->type = 1;
$crmCustomer->channel_id = $info->channel;
@@ -54,6 +54,9 @@ class InquiryToCrm implements Consumer
$crmCustomer->desc_collect = $info->content;
$crmCustomer->enter_user_id = $info->enter_user_id;
$crmCustomer->obtain = time();
if(empty($recipient)){
$crmCustomer->deleted_at = time();
}
// 修改同步CRM状态
$info->sync_crm = 1;
// 保存
+5 -2
View File
@@ -105,7 +105,7 @@ class InquiryToCrmNew implements Consumer
}
$udata = [
'corp_abbr' => $uInfo['corpId'],
'corp_id' => $uInfo['corpId'],
'user_id' => $info->recipient,
'channel_id' => $info->channel,
'country_id' => $info->country,
@@ -122,7 +122,7 @@ class InquiryToCrmNew implements Consumer
} else {
$crmCustomer = new CrmCustomer();
$crmCustomer->sn = $info->order_no;
$crmCustomer->corp_abbr = $uInfo['corpId'];
$crmCustomer->corp_id = $uInfo['corpId'];
$crmCustomer->user_id = $uInfo['recipient'];
$crmCustomer->type = 1;
$crmCustomer->channel_id = $info->channel;
@@ -135,6 +135,9 @@ class InquiryToCrmNew implements Consumer
$crmCustomer->desc_collect = $info->content;
$crmCustomer->enter_user_id = $info->enter_user_id;
$crmCustomer->obtain = time();
if(empty($uInfo['recipient'])){
$crmCustomer->deleted_at = time();
}
// 修改同步CRM状态
$info->sync_crm = 1;
// 保存
+5 -2
View File
@@ -38,7 +38,7 @@ class InquiryToCrmUpdate implements Consumer
$crmCustomerInfo = CrmCustomer::where('sn', $info->order_no)->first();
if ($crmCustomerInfo) {
$udata = [
'corp_abbr' => $corpId,
'corp_id' => $corpId,
'user_id' => $info->recipient,
'channel_id' => $info->channel,
'country_id' => $info->country,
@@ -54,7 +54,7 @@ class InquiryToCrmUpdate implements Consumer
// 同步客户数据
$crmCustomer = new CrmCustomer();
$crmCustomer->sn = $info->order_no;
$crmCustomer->corp_abbr = $corpId;
$crmCustomer->corp_id = $corpId;
$crmCustomer->user_id = $info->recipient;
$crmCustomer->type = 1;
$crmCustomer->channel_id = $info->channel;
@@ -66,6 +66,9 @@ class InquiryToCrmUpdate implements Consumer
$crmCustomer->contacts = $info->contacts;
$crmCustomer->desc_collect = $info->content;
$crmCustomer->enter_user_id = $info->enter_user_id;
if(empty($info->recipient)){
$crmCustomer->deleted_at = time();
}
// 修改同步CRM状态
$info->sync_crm = 1;
// 保存