Qualification Pairing done

This commit is contained in:
Torsten 2017-09-23 12:19:46 +02:00
parent a66189ca00
commit e0d38fac38
4 changed files with 73 additions and 172 deletions

View file

@ -166,7 +166,7 @@ class LeaguesController extends Controller
}
}
Match::createMissingMatchups();
Match::createMatchups();
return redirect("/seasons");
}
@ -177,7 +177,7 @@ class LeaguesController extends Controller
$season=Season::getCurrent();
$roundNames = Round::getNames();
$leagueNames = League::getNames();
$leagues = League::where('season_id','=',$season->id)->where('rank','=', $league_rank)->get();
$leagues = League::where('season_id','=',$season->id)->where('rank','=', $league_rank)->orderBy('id')->get();
$matchesTotal = array();
@ -188,13 +188,17 @@ class LeaguesController extends Controller
if (!key_exists($match->round_id, $matchesTotal)) {
$matchesTotal[$match->round_id]=array();
}
$lg = $matchesTotal[$match->round_id];
if (!key_exists($league->id, $matchesTotal[$match->round_id] )) {
$matchesTotal[$match->round_id][$league->id]=array();
}
$lg = $matchesTotal[$match->round_id][$league->id];
array_push($lg, $match);
$matchesTotal[$match->round_id] = $lg;
$matchesTotal[$match->round_id][$league->id] = $lg;
}
}
}
return view ('leagues.matches', compact('season', 'matchesTotal','leagues','leagueNames','roundNames'));
}