feat: 添加结算功能,更新 TicketItem 模型以支持最新结算详情,增强 DrawTickService 以自动处理结算,更新 TicketWalletService 以支持派彩入账,扩展 API 路由以管理结算批次和奖池

This commit is contained in:
2026-05-11 15:34:34 +08:00
parent 6a55fa9592
commit 19003f5041
50 changed files with 3604 additions and 3 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/** Jackpot 奖池配置与当前水位 {@see jackpot_pools} */
class JackpotPool extends Model
{
protected $fillable = [
'currency_code',
'current_amount',
'contribution_rate',
'trigger_threshold',
'payout_rate',
'force_trigger_draw_gap',
'min_bet_amount',
'status',
'last_trigger_draw_id',
];
protected function casts(): array
{
return [
'current_amount' => 'integer',
'contribution_rate' => 'decimal:4',
'trigger_threshold' => 'integer',
'payout_rate' => 'decimal:4',
'force_trigger_draw_gap' => 'integer',
'min_bet_amount' => 'integer',
'status' => 'integer',
'last_trigger_draw_id' => 'integer',
];
}
public function lastTriggerDraw(): BelongsTo
{
return $this->belongsTo(Draw::class, 'last_trigger_draw_id');
}
public function contributions(): HasMany
{
return $this->hasMany(JackpotContribution::class, 'jackpot_pool_id');
}
}