fix(wechat): 屏蔽无人参与的百家乐空局通知,防止无效消息刷屏群聊

This commit is contained in:
2026-04-02 15:46:01 +08:00
parent 310e8bc07d
commit 66451c189e

View File

@@ -225,10 +225,12 @@ class CloseBaccaratRoundJob implements ShouldQueue
broadcast(new MessageSent(1, $msg));
SaveMessageJob::dispatch($msg);
// 触发微信机器人消息推送 (百家乐结果)
// 触发微信机器人消息推送 (百家乐结果,无人参与时不推送微信群防止刷屏)
try {
$wechatService = new \App\Services\WechatBot\WechatNotificationService;
$wechatService->notifyBaccaratResult($content);
if (!empty($winners) || !empty($losers)) {
$wechatService = new \App\Services\WechatBot\WechatNotificationService;
$wechatService->notifyBaccaratResult($content);
}
} catch (\Exception $e) {
\Illuminate\Support\Facades\Log::error('WechatBot baccarat notification failed', ['error' => $e->getMessage()]);
}