league fix for League3 consisting of a single group

This commit is contained in:
TorstenS 2020-09-09 16:55:52 +02:00
parent 0eea680e51
commit 0eda6f46c2
4 changed files with 24 additions and 19 deletions

View file

@ -114,7 +114,7 @@ class Match extends Model
public static function getLeagueMatches($leagueId) {
//error_log("App\Match::getLeagueMatches(leagueId=".$leagueId.")");
error_log("App\Match::getLeagueMatches(leagueId=".$leagueId.")");
$matches = DB::table('leagues_matches')->where('league_id','=',$leagueId)->orderBy('round_id')->get();
$league=League::where('id','=',$leagueId)->first();
$season = Season::where('id','=',$league->season_id)->first();
@ -123,6 +123,9 @@ class Match extends Model
foreach($matches as $match) {
//error_log("Needed round_id: ".$match->round_id);
//error_log(" User1: ".$match->user1_id);
//error_log(" User2: ".$match->user2_id);
$match->round_name = $roundnames[$match->round_id];
$match->user1_name = $usernames[$match->user1_id];
$match->user2_name = $usernames[$match->user2_id];