fix: 增强充值队列与日结全链路幂等防重机制,彻底杜绝重复发放与脏写

这个提交包含在:
chen
2026-09-19 16:26:59 +08:00
父节点 3738bf04c2
当前提交 cbac2a69f4
共有 6 个文件被更改,包括 144 次插入 和 40 次删除

查看文件

@@ -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) {