fix(ticket): 修正 full_play/half_play/reverse 投注模式的金额计算逻辑
统一通过 $amountModePlayCode 映射选择类型到正确的金额模式: - reverse / half_play / full_play 使用 ibox 模式(单注 × 组合数) - full_cover 使用 mbox 模式(总金额平摊) - straight 保持原有 play_code 规则
This commit is contained in:
@@ -59,8 +59,17 @@ final class PlayRuleEngine
|
||||
throw new TicketOperationException('full_cover_amount_not_divisible', ErrorCode::BetInvalidPlayInput->value);
|
||||
}
|
||||
|
||||
$unitBetAmount = $this->resolveUnitBetAmount($selectionType === 'full_cover' ? 'mbox' : $playCode, $amount, $combinationCount);
|
||||
$totalBetAmount = $this->resolveTotalBetAmount($selectionType === 'full_cover' ? 'mbox' : $playCode, $amount, $unitBetAmount, $combinationCount);
|
||||
// 种类金额模式:
|
||||
// - full_cover(全保)→ 总金额平摊(mbox)
|
||||
// - reverse / half_play / full_play → 单注 × 组合数(ibox)
|
||||
// - straight → 沿用 play_code 自身规则
|
||||
$amountModePlayCode = match ($selectionType) {
|
||||
'full_cover' => 'mbox',
|
||||
'full_play', 'reverse', 'half_play' => 'ibox',
|
||||
default => $playCode,
|
||||
};
|
||||
$unitBetAmount = $this->resolveUnitBetAmount($amountModePlayCode, $amount, $combinationCount);
|
||||
$totalBetAmount = $this->resolveTotalBetAmount($amountModePlayCode, $amount, $unitBetAmount, $combinationCount);
|
||||
$dimensionInt = $this->toDimensionInt(is_string($dimension) ? $dimension : null, $playConfig);
|
||||
$primaryOdds = $this->pickPrimaryOdds($oddsItems);
|
||||
$rebateRate = (float) $primaryOdds->rebate_rate;
|
||||
|
||||
Reference in New Issue
Block a user