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)