新增百家乐游戏:①数据库表+模型 ②OpenBaccaratRoundJob开局(广播+公屏) ③CloseBaccaratRoundJob结算(摇骰+赔付+CAS防并发) ④BaccaratController下注接口 ⑤前端弹窗(倒计时/骰子动画/历史趋势) ⑥调度器每分钟检查开局 ⑦GameConfig管控开关

This commit is contained in:
2026-03-01 20:25:09 +08:00
parent 8a74bfd639
commit ff28775635
15 changed files with 1424 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
<?php
/**
* 文件功能:百家乐下注记录模型
*
* 记录用户在某局中的押注信息和结算状态。
*
* @author ChatRoom Laravel
*
* @version 1.0.0
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class BaccaratBet extends Model
{
protected $fillable = [
'round_id',
'user_id',
'bet_type',
'amount',
'payout',
'status',
];
/**
* 属性类型转换。
*/
protected function casts(): array
{
return [
'amount' => 'integer',
'payout' => 'integer',
];
}
/**
* 关联局次。
*/
public function round(): BelongsTo
{
return $this->belongsTo(BaccaratRound::class, 'round_id');
}
/**
* 关联用户。
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* 获取押注类型中文名。
*/
public function betTypeLabel(): string
{
return match ($this->bet_type) {
'big' => '大',
'small' => '小',
'triple' => '豹子',
default => '未知',
};
}
}