询单推送到crm优化
This commit is contained in:
@@ -41,7 +41,7 @@ class InquiryToCrm implements Consumer
|
|||||||
// 同步客户数据
|
// 同步客户数据
|
||||||
$crmCustomer = new CrmCustomer();
|
$crmCustomer = new CrmCustomer();
|
||||||
$crmCustomer->sn = $info->order_no;
|
$crmCustomer->sn = $info->order_no;
|
||||||
$crmCustomer->corp_abbr = $corpId;
|
$crmCustomer->corp_id = $corpId;
|
||||||
$crmCustomer->user_id = $recipient;
|
$crmCustomer->user_id = $recipient;
|
||||||
$crmCustomer->type = 1;
|
$crmCustomer->type = 1;
|
||||||
$crmCustomer->channel_id = $info->channel;
|
$crmCustomer->channel_id = $info->channel;
|
||||||
@@ -54,6 +54,9 @@ class InquiryToCrm implements Consumer
|
|||||||
$crmCustomer->desc_collect = $info->content;
|
$crmCustomer->desc_collect = $info->content;
|
||||||
$crmCustomer->enter_user_id = $info->enter_user_id;
|
$crmCustomer->enter_user_id = $info->enter_user_id;
|
||||||
$crmCustomer->obtain = time();
|
$crmCustomer->obtain = time();
|
||||||
|
if(empty($recipient)){
|
||||||
|
$crmCustomer->deleted_at = time();
|
||||||
|
}
|
||||||
// 修改同步CRM状态
|
// 修改同步CRM状态
|
||||||
$info->sync_crm = 1;
|
$info->sync_crm = 1;
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class InquiryToCrmNew implements Consumer
|
|||||||
}
|
}
|
||||||
|
|
||||||
$udata = [
|
$udata = [
|
||||||
'corp_abbr' => $uInfo['corpId'],
|
'corp_id' => $uInfo['corpId'],
|
||||||
'user_id' => $info->recipient,
|
'user_id' => $info->recipient,
|
||||||
'channel_id' => $info->channel,
|
'channel_id' => $info->channel,
|
||||||
'country_id' => $info->country,
|
'country_id' => $info->country,
|
||||||
@@ -122,7 +122,7 @@ class InquiryToCrmNew implements Consumer
|
|||||||
} else {
|
} else {
|
||||||
$crmCustomer = new CrmCustomer();
|
$crmCustomer = new CrmCustomer();
|
||||||
$crmCustomer->sn = $info->order_no;
|
$crmCustomer->sn = $info->order_no;
|
||||||
$crmCustomer->corp_abbr = $uInfo['corpId'];
|
$crmCustomer->corp_id = $uInfo['corpId'];
|
||||||
$crmCustomer->user_id = $uInfo['recipient'];
|
$crmCustomer->user_id = $uInfo['recipient'];
|
||||||
$crmCustomer->type = 1;
|
$crmCustomer->type = 1;
|
||||||
$crmCustomer->channel_id = $info->channel;
|
$crmCustomer->channel_id = $info->channel;
|
||||||
@@ -135,6 +135,9 @@ class InquiryToCrmNew implements Consumer
|
|||||||
$crmCustomer->desc_collect = $info->content;
|
$crmCustomer->desc_collect = $info->content;
|
||||||
$crmCustomer->enter_user_id = $info->enter_user_id;
|
$crmCustomer->enter_user_id = $info->enter_user_id;
|
||||||
$crmCustomer->obtain = time();
|
$crmCustomer->obtain = time();
|
||||||
|
if(empty($uInfo['recipient'])){
|
||||||
|
$crmCustomer->deleted_at = time();
|
||||||
|
}
|
||||||
// 修改同步CRM状态
|
// 修改同步CRM状态
|
||||||
$info->sync_crm = 1;
|
$info->sync_crm = 1;
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class InquiryToCrmUpdate implements Consumer
|
|||||||
$crmCustomerInfo = CrmCustomer::where('sn', $info->order_no)->first();
|
$crmCustomerInfo = CrmCustomer::where('sn', $info->order_no)->first();
|
||||||
if ($crmCustomerInfo) {
|
if ($crmCustomerInfo) {
|
||||||
$udata = [
|
$udata = [
|
||||||
'corp_abbr' => $corpId,
|
'corp_id' => $corpId,
|
||||||
'user_id' => $info->recipient,
|
'user_id' => $info->recipient,
|
||||||
'channel_id' => $info->channel,
|
'channel_id' => $info->channel,
|
||||||
'country_id' => $info->country,
|
'country_id' => $info->country,
|
||||||
@@ -54,7 +54,7 @@ class InquiryToCrmUpdate implements Consumer
|
|||||||
// 同步客户数据
|
// 同步客户数据
|
||||||
$crmCustomer = new CrmCustomer();
|
$crmCustomer = new CrmCustomer();
|
||||||
$crmCustomer->sn = $info->order_no;
|
$crmCustomer->sn = $info->order_no;
|
||||||
$crmCustomer->corp_abbr = $corpId;
|
$crmCustomer->corp_id = $corpId;
|
||||||
$crmCustomer->user_id = $info->recipient;
|
$crmCustomer->user_id = $info->recipient;
|
||||||
$crmCustomer->type = 1;
|
$crmCustomer->type = 1;
|
||||||
$crmCustomer->channel_id = $info->channel;
|
$crmCustomer->channel_id = $info->channel;
|
||||||
@@ -66,6 +66,9 @@ class InquiryToCrmUpdate implements Consumer
|
|||||||
$crmCustomer->contacts = $info->contacts;
|
$crmCustomer->contacts = $info->contacts;
|
||||||
$crmCustomer->desc_collect = $info->content;
|
$crmCustomer->desc_collect = $info->content;
|
||||||
$crmCustomer->enter_user_id = $info->enter_user_id;
|
$crmCustomer->enter_user_id = $info->enter_user_id;
|
||||||
|
if(empty($info->recipient)){
|
||||||
|
$crmCustomer->deleted_at = time();
|
||||||
|
}
|
||||||
// 修改同步CRM状态
|
// 修改同步CRM状态
|
||||||
$info->sync_crm = 1;
|
$info->sync_crm = 1;
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
Reference in New Issue
Block a user