Merge branch 'develop' into feature/mzl_dev

This commit is contained in:
mzl
2025-08-23 13:54:33 +08:00
3 changed files with 27 additions and 10 deletions
+5 -1
View File
@@ -60,9 +60,13 @@ class InquiryLog extends Model
return $this->hasOne(User::class, 'id', 'enter_user_id');
}
// public function recipientInfo()
// {
// return $this->hasOne(User::class, 'id', 'recipient')->where('status', 1);
// }
public function recipientInfo()
{
return $this->hasOne(User::class, 'id', 'recipient')->where('status', 1);
return $this->hasOne(User::class, 'id', 'recipient');
}
public function channelInfo()
@@ -162,6 +162,8 @@ class InquiryLogService
$data['r_time'] = time();
$data['t_time'] = time();
$data['status'] = 2;
} else {
$data['recipient'] = 0;
}
return $data;
}
+20 -9
View File
@@ -68,15 +68,26 @@ class InquiryToCrm implements Consumer
throw new BusinessException('同步失败~');
}
// 发送邮件消息
if ($uinfo && $uinfo->email) {
$options = [
'id' => $info->id,
'email' => $uinfo->email
];
// Log::info('发送邮件消息:' . json_encode($options));
\Webman\RedisQueue\Redis::send('email-message', $options);
}
// // 发送邮件消息
// if ($uinfo && $uinfo->email) {
// $options = [
// 'id' => $info->id,
// 'email' => $uinfo->email
// ];
// // Log::info('发送邮件消息:' . json_encode($options));
// \Webman\RedisQueue\Redis::send('email-message', $options);
// }
$wsdata = [
'sender_id' => 0,
'sender_type' => 'system',
'title' => '有新的客户线索,' . $info->order_no . ',请及时处理',
'content' => '有新的客户线索,' . $info->order_no . ',请及时处理',
'scene' => 1,
'recipient' => [$info->recipient]
];
// 异步推送
\Webman\RedisQueue\Redis::send('notice', $wsdata);
}
} catch (\Throwable $th) {
throw $th;