1.修复抽奖档位不统一的问题

This commit is contained in:
2026-06-02 17:04:55 +08:00
parent 13dacc8fdd
commit c0d5258aee
8 changed files with 55 additions and 54 deletions

View File

@@ -187,9 +187,9 @@ class PlayStartLogic
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
$realEv = (float) ($chosen['real_ev'] ?? 0);
// T5/再来一次:以奖励行 tier 为准,并以摇奖档位 $tier 兜底(与 reward_tier 展示一致,避免 dice_reward 行缺 tier 时不发券)
$isTierT5 = (string) ($chosen['tier'] ?? '') === 'T5';
if ($isTierT5 === false && (string) ($tier ?? '') === 'T5') {
$isTierT5 = true;
$isTierPlayAgain = (string) ($chosen['tier'] ?? '') === 'T5';
if ($isTierPlayAgain === false && (string) ($tier ?? '') === 'T5') {
$isTierPlayAgain = true;
}
// 摇色子中奖:按 dice_reward_config.real_ev 直接结算(已乘 ante
$rewardWinCoin = round($realEv * $ante, 2);
@@ -230,7 +230,7 @@ class PlayStartLogic
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
$rewardWinCoin = 0.0;
$realEv = 0.0;
$isTierT5 = false;
$isTierPlayAgain = false;
} else {
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
}
@@ -276,7 +276,7 @@ class PlayStartLogic
$startIndex,
$targetIndex,
$rollArray,
$isTierT5,
$isTierPlayAgain,
$tier,
&$record,
&$settledWinCoin
@@ -372,7 +372,7 @@ class PlayStartLogic
// 若本局中奖档位为 T5则额外赠送 1 次免费抽奖次数:
// - 新结构:写入 free_ticketante=本局注数count+1
// - 兼容旧结构free_ticket_count +1
if ($isTierT5) {
if ($isTierPlayAgain) {
$ft = $p->free_ticket ?? null;
$ftAnte = null;
$ftCount = 0;
@@ -654,6 +654,7 @@ class PlayStartLogic
*/
public function simulateOnePlay($config, int $direction, int $lotteryType = 0, int $ante = 1, ?array $customTierWeights = null, ?int $configDeptId = null): array
{
$useKillMode = false;
$rewardInstance = DiceReward::getCachedInstance($configDeptId);
$byTierDirection = $rewardInstance['by_tier_direction'] ?? [];
$maxTierRetry = 10;