Showing next season rank. Not fully working

This commit is contained in:
Torsten 2017-11-04 08:20:54 +01:00
parent beaba1d389
commit 3f5db4d78c
2 changed files with 16 additions and 4 deletions

View file

@ -104,14 +104,24 @@ class LeaguesController extends Controller
}
public static function showLeagueRanking($rank, $maxRoundId=-1) {
$season = Season::getCurrent();
$leagues = array_reverse(League::getRanking($rank));
$season = Season::getCurrent();
$leagues = array_reverse(League::getRanking($rank));
$leagueNames = League::getNames();
$userNames = User::getNames();
$userNames = User::getNames();
$leagueScores = League::getRanking($rank);
return view ('leagues.chart',compact('season','leagues', 'leagueNames', 'userNames','leagueScores'));
$totalRanking = League::getTotalRankingOverall(); // Nur für Auf/Abstiegsinfo benötigt.
$rankInfo=array();
foreach($totalRanking as $index => $entry) {
$userId=$entry[0];
$rank=3;
if ($index<44) { $rank=2; }
if ($index<22) { $rank=1; }
$rankInfo[$userId]=$rank;
}
return view ('leagues.chart',compact('season','leagues', 'leagueNames', 'userNames','leagueScores','rankInfo'));
}
public static function showSingleUserMatches($userId) {

View file

@ -16,6 +16,7 @@
<td class="table-bordered" style="width:50px;">Punkte</td>
<td class="table-bordered" style="width:150px;">Tordifferenz</td>
<td class="table-bordered" style="width:150px;">Torverhältnis</td>
<td class="table-bordered" style="width:150px;">Quali-Rang</td>
</tr>
<!-- Start Matchgruppen-Loop-->
@ -26,6 +27,7 @@
<td>&nbsp; {{$player[1]}} &nbsp;</td>
<td>&nbsp; {{$player[2]-$player[3]}} &nbsp;</td>
<td>&nbsp; {{$player[2]}}:{{$player[3]}} &nbsp;</td>
<td>&nbsp; {{$rankInfo[$player[0]]}} &nbsp;</td>
</tr>
@endforeach