|
|
@@ -440,7 +440,7 @@ class PromotionService
|
|
|
if (!$activityId && FirstDepositChoice::ready() && !FirstDepositChoice::legacyOrder($orderSource, (int) $deposit->related_id)) return;
|
|
|
|
|
|
// 多个首充活动按档位发放:在所有可参加的首充活动里,取充值金额达到门槛、奖励最高的一个(份数或额度用完时取下一档)。
|
|
|
- // 会员确认的禁止游戏大类(全部首充活动统一)沿用确认时的快照;选中的那个活动沿用确认时的完整规则。
|
|
|
+ // 会员确认的那个活动沿用确认时的奖励和打码倍数;禁止的游戏大类以后台当前设置为准(下注时实时读)。
|
|
|
// 只在会员确认时所在的端(PC/H5/APP/TG)发布的活动里选;上线前的选择没有记录端,按会员确认的那个活动发布的端。
|
|
|
$snapshot = $activityId ? $this->json($choice->rule_snapshot) : null;
|
|
|
$platforms = isset($snapshot['platform']) ? [$snapshot['platform']] : [];
|
|
|
@@ -464,9 +464,10 @@ class PromotionService
|
|
|
if (!$published || $creditedAt < $published || !ActivityPeriod::contains($activity->start_time, $activity->end_time, strtotime($creditedAt))) continue;
|
|
|
if (!ActivityEligibilityService::evaluate($activity, ActivityEligibilityService::memberContext($member->member_id))['is_eligible']) continue;
|
|
|
// Pre-cutover orders keep their legacy reward without new restrictions.
|
|
|
+ // 禁止的游戏大类在下注时实时读后台设置,这里的快照只作记录。
|
|
|
if ($snapshot === null) $rules = array_replace($this->rules($activity), ['forbidden_categories' => []]);
|
|
|
- elseif ((int)$activity->id === $activityId) $rules = $snapshot;
|
|
|
- else $rules = array_replace($this->rules($activity), ['forbidden_categories' => $snapshot['forbidden_categories'] ?? []]);
|
|
|
+ elseif ((int)$activity->id === $activityId) $rules = array_replace($snapshot, ['forbidden_categories' => Rules::forbiddenSetting()]);
|
|
|
+ else $rules = $this->rules($activity);
|
|
|
if (!$rules || bccomp((string)$deposit->amount, (string)$rules['min_deposit'], 10) < 0) continue;
|
|
|
$candidates[] = [$activity, $rules];
|
|
|
}
|
|
|
@@ -490,10 +491,10 @@ class PromotionService
|
|
|
$rewards = DB::table('promotion_rewards')->where('user_id', $userId)->whereIn('status', ['paid', 'locked'])
|
|
|
->where('required_flow', '>', 0)->sharedLock()->get();
|
|
|
$categories = array_keys(ShareDefaults::commissionCategories());
|
|
|
+ // 禁止的游戏大类实时读后台当前设置,不用发奖时存下的快照。
|
|
|
+ $forbidden = array_values(array_intersect($categories, Rules::forbiddenSetting()));
|
|
|
+ if (!in_array('self:lottery', $forbidden, true) || count($forbidden) === count($categories)) return false;
|
|
|
foreach ($rewards as $reward) {
|
|
|
- $configured = (array) ($this->json($reward->rule_snapshot)['forbidden_categories'] ?? []);
|
|
|
- $forbidden = array_intersect($categories, array_filter($configured, 'is_string'));
|
|
|
- if (!in_array('self:lottery', $forbidden, true) || count($forbidden) === count($categories)) continue;
|
|
|
$activity = DB::table('promotion_activities')->where('id', $reward->activity_id)->where('type', Rules::FIRST_DEPOSIT)
|
|
|
->where('status', 1)->sharedLock()->first(['start_time', 'end_time']);
|
|
|
if (!$activity || !ActivityPeriod::contains($activity->start_time, $activity->end_time, now()->timestamp)) continue;
|