feat: 增强奖池与钱包管理功能
更新 AdminJackpotPoolUpdateController 校验规则,禁止传入 current_amount。 优化 AdminRiskPoolManualStatusController:更新奖池状态后同步 Redis 状态。 在 TransferOrderReconcileController 中新增 completeCredit 方法,用于处理卡住的转账订单对账。 调整 TransferOrderListController:优化转账订单处理条件。 在 TicketItemsIndexController 中实现支持时区的日期筛选,提升日期处理准确性。 扩展 JackpotPool 模型,新增 adjustments 关联关系。 改进票据与钱包相关服务中的错误处理和事务管理。
This commit is contained in:
@@ -46,4 +46,9 @@ final class JackpotPool extends Model
|
||||
{
|
||||
return $this->hasMany(JackpotContribution::class, 'jackpot_pool_id');
|
||||
}
|
||||
|
||||
public function adjustments(): HasMany
|
||||
{
|
||||
return $this->hasMany(JackpotPoolAdjustment::class, 'jackpot_pool_id');
|
||||
}
|
||||
}
|
||||
|
||||
41
app/Models/JackpotPoolAdjustment.php
Normal file
41
app/Models/JackpotPoolAdjustment.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/** 奖池余额人工调整流水 {@see jackpot_pool_adjustments} */
|
||||
final class JackpotPoolAdjustment extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'adjustment_no',
|
||||
'jackpot_pool_id',
|
||||
'admin_user_id',
|
||||
'amount_delta',
|
||||
'balance_before',
|
||||
'balance_after',
|
||||
'reason',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'amount_delta' => 'integer',
|
||||
'balance_before' => 'integer',
|
||||
'balance_after' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
/** @return BelongsTo<JackpotPool, JackpotPoolAdjustment> */
|
||||
public function pool(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(JackpotPool::class, 'jackpot_pool_id');
|
||||
}
|
||||
|
||||
/** @return BelongsTo<AdminUser, JackpotPoolAdjustment> */
|
||||
public function adminUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(AdminUser::class, 'admin_user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user