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']) {