Rangliste vollständig

This commit is contained in:
Torsten 2017-06-27 08:22:25 +02:00
parent 43fd8c8cbf
commit c4973664b9
8 changed files with 76 additions and 68 deletions

View file

@ -113,16 +113,13 @@ class UsersController extends Controller
if (!$currentSeason) { return redirect("/"); }
if($round_id==-1) {
$round_id = Round::getLastCompleteRoundId();
$round_id = Round::getLastLockedRoundId();
//Log::info("Last complete round id=" . $round_id);
if ($round_id==-1) {return redirect("/");}
}
if (Auth::guest()) { return redirect("/"); }
TippsController::createAllTips();
$users = DB::table('users')->where('deleted',null)->get();
@ -149,8 +146,6 @@ class UsersController extends Controller
$user->dayScore += $score;
}
//if ($user->id==3 && $score>0) { Log::info("Adding score=" . $score. "from game_id=".$game->id."(".$game->team1." - ".$game->team2.", ".$round->name.") totalScore=".$user->totalScore.", dayScore=".$user->dayScore); }
$tippDisplay[$user->id][$game->id][0] = $tipp->score1 ==-1 ? 'x' : $tipp->score1;
$tippDisplay[$user->id][$game->id][1] = $tipp->score2 ==-1 ? 'x' : $tipp->score2;
$tippDisplay[$user->id][$game->id][2] = $tipp->joker;
@ -171,7 +166,8 @@ class UsersController extends Controller
$round=Round::where('id','=',$round_id)->first();
$games=Game::where('round_id','=',$round->id)->get();
return view('users.ranking', compact('users','round','games','tippDisplay'));
$all_rounds=Round::where('season_id','=',$currentSeason->id)->get();
return view('users.ranking', compact('users','round','all_rounds','games','tippDisplay'));
}