Merge branch 'feature/mzl_dev'

This commit is contained in:
mzl
2025-08-04 14:03:57 +08:00
parent 8f74999b47
commit b2d4119e46
25 changed files with 2066 additions and 47 deletions
+18 -14
View File
@@ -29,19 +29,20 @@ class InquiryToCrm implements Consumer
// 获取用户信息
$recipient = 0;
$corpId = 0;
$uinfo = null;
if ($info->recipient) {
$recipient = $info->recipient;
$uinfo = User::where('id', $info->recipient)->first();
if ($uinfo) {
$corpId = $uinfo->corp_id;
}
// 消息推送参数 分配
$scene = 'inquiry-person-allocation';
$receiveType = 'person';
// // 消息推送参数 分配
// $scene = 'inquiry-person-allocation';
// $receiveType = 'person';
} else {
// 消息推送参数 发布
$scene = 'inquiry-group-send';
$receiveType = 'group';
// // 消息推送参数 发布
// $scene = 'inquiry-group-send';
// $receiveType = 'group';
}
// 同步客户数据
$crmCustomer = new CrmCustomer();
@@ -65,14 +66,17 @@ class InquiryToCrm implements Consumer
throw new BusinessException('同步失败~');
}
// 发送飞书消息
$options = [
'id' => $info->id,
'category' => 'inquiry',
'scene' => $scene,
'receive_type' => $receiveType
];
\Webman\RedisQueue\Redis::send('feishu-message', $options);
// 发送邮件消息
if ($uinfo && $uinfo->email) {
$options = [
'id' => $info->id,
'email' => $uinfo->email,
// 'category' => 'inquiry',
// 'scene' => $scene,
// 'receive_type' => $receiveType
];
\Webman\RedisQueue\Redis::send('email-message', $options);
}
}
} catch (\Throwable $th) {
throw $th;