fix: 增强充值队列与日结全链路幂等防重机制,彻底杜绝重复发放与脏写
这个提交包含在:
@@ -253,6 +253,16 @@ class VoucherService
|
||||
|
||||
public function releaseByDate($settleDate)
|
||||
{
|
||||
// 幂等防重:检查该结算日期是否已释放过兑换券
|
||||
$existingCount = RewardModel::where('settle_date', $settleDate)
|
||||
->where('reward_type', 'voucher_release')
|
||||
->count();
|
||||
if ($existingCount > 0) {
|
||||
return (float) RewardModel::where('settle_date', $settleDate)
|
||||
->where('reward_type', 'voucher_release')
|
||||
->sum('amount');
|
||||
}
|
||||
|
||||
$plans = VoucherPlan::where('status', 1)
|
||||
->where('start_date', '<=', $settleDate)
|
||||
->select();
|
||||
|
||||
在新工单中引用
屏蔽一个用户