From ff0e6dfb465ad5bc0574edacca8528f7dfb1e9fe Mon Sep 17 00:00:00 2001 From: Torsten Date: Thu, 16 Nov 2017 09:05:26 +0100 Subject: [PATCH] Added roundname for missing tipps and jokers --- pfosten/app/Http/Controllers/UsersController.php | 7 ++++++- pfosten/app/Round.php | 10 +--------- pfosten/resources/views/users/index.blade.php | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pfosten/app/Http/Controllers/UsersController.php b/pfosten/app/Http/Controllers/UsersController.php index 8c53abc6..19c95305 100755 --- a/pfosten/app/Http/Controllers/UsersController.php +++ b/pfosten/app/Http/Controllers/UsersController.php @@ -124,7 +124,12 @@ class UsersController extends Controller } } - return view('users.index', compact('users','active_user_count','total_user_count')); + $round = Round::getFirstTippableRound(); + $firstTippableRound=new Round(); + $firstTippableRound->name="-"; + if ($round) { $firstTippableRound = $round; } + + return view('users.index', compact('users','active_user_count','total_user_count', 'firstTippableRound')); } /* public function showUsers() { diff --git a/pfosten/app/Round.php b/pfosten/app/Round.php index ef20847a..b1fbd849 100755 --- a/pfosten/app/Round.php +++ b/pfosten/app/Round.php @@ -123,15 +123,7 @@ class Round extends Model } public static function getFirstTippableRoundId($seasonId=-1) { - $season=null; - if ($seasonId==-1) { - $season=Season::getCurrent(); - } else { - $season=Season::where('id','=', $seasonId)->first(); - } - if (!$season) return null; - - $round = Round::getFirstTippableRound($season->id); + $round = Round::getFirstTippableRound(); if (!$round) return -1; return $round->id; } diff --git a/pfosten/resources/views/users/index.blade.php b/pfosten/resources/views/users/index.blade.php index 614210ce..d59c9744 100644 --- a/pfosten/resources/views/users/index.blade.php +++ b/pfosten/resources/views/users/index.blade.php @@ -15,8 +15,8 @@  Saison bezahlt   E-Mail Adresse  Status - Tipps - Joker + Tipps
{{$firstTippableRound->name}} + Joker
{{$firstTippableRound->name}} @foreach($users as $user)