Rangliste standardmaessig zur aktuellen gesperrten Runde oeffnen
This commit is contained in:
parent
c554ce8f08
commit
9df54016df
1 changed files with 4 additions and 9 deletions
|
|
@ -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']) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue