1.优化接口/api/game/lobbyInit,新增赔率参数

This commit is contained in:
2026-05-15 15:46:06 +08:00
parent 90ec085cd5
commit 575aa279bd
3 changed files with 53 additions and 13 deletions

View File

@@ -106,6 +106,25 @@ final class StreakWinReward
return self::$cache;
}
/**
* lobbyInit 用:连胜赔率档位(与后台「连胜奖励」、派彩公式一致)。
*
* @return array{rows: list<array{streak: int, odds_factor: int, is_jackpot: bool}>}
*/
public static function lobbyPayload(): array
{
$rows = [];
foreach (self::loadRows() as $row) {
$rows[] = [
'streak' => (int) ($row['streak'] ?? 0),
'odds_factor' => (int) ($row['odds_factor'] ?? 0),
'is_jackpot' => ($row['is_jackpot'] ?? false) === true,
];
}
return ['rows' => $rows];
}
/**
* streak_at_bet 为下注时快照0 表示尚未连胜);档位取 min(streak_at_bet+1, 10)。
*/