feat(baccarat): 实现百家乐实时下注人数统计功能
- 新增 BaccaratPoolUpdated 事件,用于通过 WebSocket 广播实时下注数据更新 - 增加数据库迁移以在 baccarat_rounds 表中添加对应的下注人数统计字段 - 更新 BaccaratRound 模型以及 BaccaratController,支持实时下注统计更新与 WebSocket 事件分发 - 更新前端 chat.js 以及 baccarat-panel.blade.php,利用 Alpine.js 和 Echo 接收事件并动态渲染 "大"、"小"、"豹子" 的实时下注计数
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:在百家乐局次表增加下注人数分项统计
|
||||
*
|
||||
* 为支持前端实时显示“押大”、“押小”、“押豹子”的人数,增加记录各类型的押注人次。
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* 执行迁移。
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('baccarat_rounds', function (Blueprint $table) {
|
||||
$table->unsignedInteger('bet_count_big')->default(0)->after('bet_count')->comment('押大人数');
|
||||
$table->unsignedInteger('bet_count_small')->default(0)->after('bet_count_big')->comment('押小人数');
|
||||
$table->unsignedInteger('bet_count_triple')->default(0)->after('bet_count_small')->comment('押豹子人数');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚迁移。
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('baccarat_rounds', function (Blueprint $table) {
|
||||
$table->dropColumn(['bet_count_big', 'bet_count_small', 'bet_count_triple']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user