Show player matches for single userId

This commit is contained in:
Torsten 2017-09-30 13:14:46 +02:00
parent 93d7670b48
commit 98ebdb6c93
7 changed files with 163 additions and 9 deletions

View file

@ -198,11 +198,31 @@ class LeaguesController extends Controller
$matchesTotal[$match->round_id][$league->id] = $lg;
}
}
}
}
return view ('leagues.matches', compact('season', 'matchesTotal','leagues','leagueNames','roundNames'));
}
public static function showLeagueRanking($rank, $maxRoundId=-1) {
$season = Season::getCurrent();
$leagues = array_reverse(League::getRanking($rank));
$leagueNames = League::getNames();
$userNames = User::getNames();
$leagueScores = League::getRanking($rank);
return view ('leagues.chart',compact('season','leagues', 'leagueNames', 'userNames','leagueScores'));
}
public static function showSingleUserMatches($userId) {
$season = Season::getCurrent();
$leagueNames = League::getNames();
$roundNames = Round::getNames();
$matches = Match::getMatchResultsForUser($userId);
$user = User::where('id','=', $userId)->first();
$userName = $user->name;
return view ('leagues.playermatches',compact('season','leagueNames','roundNames','matches','userName'));
}
}