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

@ -29,6 +29,8 @@ class Round extends Model
return false;
}
public static function isCompleted($round_id) {
$round = Round::where('id','=',$round_id)->first();
$games = Game::where('round_id','=',$round->id)->get();
@ -51,4 +53,16 @@ class Round extends Model
return $lastCompleteRound;
}
public static function getLastLockedRoundId() {
$season = Season::getCurrent();
$rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get();
$lastLockedRoundId=-1;
foreach ($rounds as $round) {
if (Round::hasLockedGame($round->id) == true) {
$lastLockedRoundId = $round->id;
}
}
return $lastLockedRoundId;
}
}