新增老虎机游戏:①slot_machine_logs表+模型(8种权重图案/判奖) ②SlotMachineController(扣费/随机/赔付/诅咒/三7全服广播) ③前台面板(三列滚轮动画/逐列停止/赔率说明/历史记录) ④CurrencySource三个枚举

This commit is contained in:
2026-03-01 21:00:21 +08:00
parent dfa7278184
commit 9359184e38
7 changed files with 905 additions and 3 deletions

View File

@@ -0,0 +1,43 @@
<?php
/**
* 文件功能:老虎机游戏记录表迁移
*
* 每次转动老虎机产生一条记录,包含三列图案、结果类型、赔付金额。
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 创建 slot_machine_logs 表。
*/
public function up(): void
{
Schema::create('slot_machine_logs', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->comment('玩家 ID');
$table->string('reel1', 10)->comment('第一列图案 key');
$table->string('reel2', 10)->comment('第二列图案 key');
$table->string('reel3', 10)->comment('第三列图案 key');
$table->enum('result_type', ['jackpot', 'triple_gem', 'triple', 'pair', 'curse', 'miss'])
->comment('结果类型');
$table->unsignedInteger('cost')->comment('消耗金币');
$table->integer('payout')->default(0)->comment('净赔付金额(正=赢,负=输)');
$table->timestamps();
$table->index(['user_id', 'created_at']);
});
}
/**
* 回滚迁移。
*/
public function down(): void
{
Schema::dropIfExists('slot_machine_logs');
}
};