GSHirt Payout Anzeige in Geldrangliste eingebaut

This commit is contained in:
Torsten 2018-01-31 09:12:56 +01:00
parent 3bdb32ae75
commit 52aacdc76f
3 changed files with 87 additions and 22 deletions

View file

@ -220,8 +220,11 @@ class Round extends Model
return $roundnames;
}
public static function getLastRoundId($seasonId) {
$round = Round::where('season_id', '=', $seasonId)->orderBy('id','desc')->first(); // get last entry
public static function getLastRoundId($seasonId=-1) {
$season= Season::getCurrent();
if ($seasonId!=-1) { $season = Season::where('id','=',$seasonId)->first(); }
$round = Round::where('season_id', '=', $season->id)->orderBy('id','desc')->first(); // get last entry
return $round->id;
}