fix: 增强充值队列与日结全链路幂等防重机制,彻底杜绝重复发放与脏写
这个提交包含在:
@@ -11,6 +11,18 @@ class MadowService
|
||||
{
|
||||
public function share($settleDate, $gmv, $userIds)
|
||||
{
|
||||
// 幂等防重:检查该结算日期是否已分发过madow
|
||||
$existing = \think\Db::name('shopro_partner_reward')
|
||||
->where('settle_date', $settleDate)
|
||||
->where('reward_type', 'madow_share')
|
||||
->find();
|
||||
if ($existing) {
|
||||
$pool = (float) $gmv;
|
||||
$count = count($userIds);
|
||||
$each = $existing['madow'] ?? 0;
|
||||
return ['pool' => $pool, 'count' => $count, 'each' => $each];
|
||||
}
|
||||
|
||||
$count = count($userIds);
|
||||
$pool = (float) $gmv;
|
||||
if ($pool <= 0) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户