League Quali Spielplan berechnen & anzeigen

This commit is contained in:
Torsten 2017-09-26 07:57:39 +02:00
parent e0d38fac38
commit 93d7670b48
5 changed files with 58 additions and 10 deletions

View file

@ -171,9 +171,11 @@ class LeaguesController extends Controller
return redirect("/seasons");
}
public function showLeagueRounds($league_rank, $round_id) { // $round_id = $max_round_id
public function showLeagueRounds($league_rank, $maxRoundId) {
if (Auth::guest()) { return redirect("/"); }
$maxRoundId = min(Round::getLastCompleteRoundId(),$maxRoundId);
$season=Season::getCurrent();
$roundNames = Round::getNames();
$leagueNames = League::getNames();
@ -182,9 +184,9 @@ class LeaguesController extends Controller
$matchesTotal = array();
foreach ($leagues as $league) {
$matches = Match::getLeagueMatches($league->id);
$matches = Match::getMatchResults($league->id, $maxRoundId);
foreach ($matches as $match) {
if ($match->round_id <= $round_id) {
if ($match->round_id <= $maxRoundId) {
if (!key_exists($match->round_id, $matchesTotal)) {
$matchesTotal[$match->round_id]=array();
}