From 9df54016dfce0e87dfb24cfe2f544d377caeb45f Mon Sep 17 00:00:00 2001 From: torsten Date: Tue, 3 Nov 2026 20:49:11 +0100 Subject: [PATCH] Rangliste standardmaessig zur aktuellen gesperrten Runde oeffnen --- tippspiel/public/index.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tippspiel/public/index.php b/tippspiel/public/index.php index 7497666..32e3b27 100644 --- a/tippspiel/public/index.php +++ b/tippspiel/public/index.php @@ -908,24 +908,19 @@ if ($page === 'reminder') { } // Auswählbar sind nur gesperrte Runden (erstes Spiel angepfiffen), - // Standard ist die letzte Runde mit Ergebnis + // Standard ist die zuletzt gesperrte Runde (Legacy Round::getLastLockedRoundId). + // Nicht die letzte Runde mit Ergebnis: Bei laufender Runde ohne Ergebnis + // würde sonst die vorherige, bereits abgeschlossene Runde erscheinen. $allRounds = []; - $defaultRound = null; foreach (Round::getBySeason($currentSeason['id']) as $round) { $roundGames = Game::getGamesByRound($round['id']); if (empty($roundGames) || !Game::isLocked($roundGames[0]['kickoff'])) { continue; } $allRounds[] = $round; - foreach ($roundGames as $game) { - if ((int)$game['score1'] > -1) { - $defaultRound = $round; - break; - } - } } - $selectedRound = $defaultRound ?? ($allRounds[0] ?? null); + $selectedRound = !empty($allRounds) ? $allRounds[count($allRounds) - 1] : null; if (isset($_GET['round_id'])) { foreach ($allRounds as $round) { if ((int)$round['id'] === (int)$_GET['round_id']) {