feat: 增加百家乐下注公屏播报通知

This commit is contained in:
2026-03-28 22:07:12 +08:00
parent a3edb7538a
commit f0d92b21be
2 changed files with 28 additions and 4 deletions

View File

@@ -154,6 +154,28 @@ class BaccaratController extends Controller
'big' => '大', 'small' => '小', default => '豹子'
};
// 发送系统传音到聊天室,公示该用户的押注信息
$chatState = app(\App\Services\ChatStateService::class);
$formattedAmount = number_format($data['amount']);
$roomId = $round->room_id ?? 1;
// 格式:🌟 🎲 娜姐 押注了 119 金币(大)!✨
$content = "🌟 🎲 <b>{$user->username}</b> 押注了 <b>{$formattedAmount}</b> 金币({$betLabel})!✨";
$msg = [
'id' => $chatState->nextMessageId($roomId),
'room_id' => $roomId,
'from_user' => '系统传音',
'to_user' => '大家',
'content' => $content,
'is_secret' => false,
'font_color' => '#d97706',
'action' => '',
'sent_at' => now()->toDateTimeString(),
];
$chatState->pushMessage($roomId, $msg);
event(new \App\Events\MessageSent($roomId, $msg));
\App\Jobs\SaveMessageJob::dispatch($msg);
return response()->json([
'ok' => true,
'message' => "✅ 已押注「{$betLabel}{$data['amount']} 金币,等待开奖!",

View File

@@ -201,18 +201,20 @@ class AiBaccaratBetJob implements ShouldQueue
$labelMap = ['big' => '大', 'small' => '小', 'triple' => '豹子'];
$betLabel = $labelMap[$betType] ?? $betType;
$sourceTag = $decisionSource === 'ai' ? '🤖 AI分析' : '📊路单统计';
$formattedAmount = number_format($amount);
$content = "{$sourceTag} 小班长投了 {$amount} 金币,压【{$betLabel}】,大家加油!🎲";
// 格式:🌟 🎲 【百家乐】 娜姐 押注了 119 金币(大)!✨ [🤖 AI分析]
$content = "🌟 🎲 【百家乐】 <b>{$user->username}</b> 押注了 <b>{$formattedAmount}</b> 金币({$betLabel})!✨ [{$sourceTag}]";
$msg = [
'id' => $chatState->nextMessageId($roomId),
'room_id' => $roomId,
'from_user' => $user->username,
'from_user' => '系统传音',
'to_user' => '大家',
'content' => $content,
'is_secret' => false,
'font_color' => null,
'action' => '',
'font_color' => '#d97706',
'action' => '',
'sent_at' => now()->toDateTimeString(),
];