several cosmetic updates
This commit is contained in:
parent
5a90bb2c8a
commit
8c368524fe
8 changed files with 56 additions and 24 deletions
|
|
@ -62,17 +62,12 @@ class TippsController extends Controller
|
|||
return redirect('/');
|
||||
}
|
||||
|
||||
|
||||
if (! User::payment_date($user->id, $activeSeason->id)) {
|
||||
return view('users.no_payment');
|
||||
}
|
||||
|
||||
|
||||
$rounds = null;
|
||||
|
||||
|
||||
|
||||
|
||||
TippsController::createTipps($user->id); // ggfs. fehlender Tipp Eintraege einfügen
|
||||
|
||||
|
||||
|
|
@ -106,20 +101,21 @@ class TippsController extends Controller
|
|||
|
||||
$user=Auth::user();
|
||||
|
||||
if (Game::locked(request('id'))) return redirect('/tipps'); // Für Schlauberger, die die Tippmaske auflassen.
|
||||
|
||||
// Fetch, modify, save Tipp
|
||||
$tipp = Tipp::where('id', request('id'))->first();
|
||||
$game = Game::where('id', $tipp->game_id)->first();
|
||||
$round= Round::where('id',$game->round_id)->first();
|
||||
if (Round::hasLockedGame($round->id)) { return redirect('/tipps'); } // Für Schlauberger, die die Tippmaske auflassen.
|
||||
|
||||
$tipp->score1= request('score1');
|
||||
$tipp->score2= request('score2');
|
||||
|
||||
if (request()->has('joker')) {
|
||||
if (Round::hasLockedGame(request('round_id'))==false) { // Jokermod nur wenn Runde noch nicht begonnen hat
|
||||
$tipp->joker=true;
|
||||
} else {
|
||||
$tipp->joker = false;
|
||||
}
|
||||
$tipp->joker=true;
|
||||
} else {
|
||||
$tipp->joker = false;
|
||||
}
|
||||
|
||||
$tipp->save();
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue