Working on Roundmail system
This commit is contained in:
parent
3fa31921f0
commit
6d7ee1a47c
11 changed files with 224 additions and 24 deletions
|
|
@ -55,6 +55,21 @@ class Round extends Model
|
|||
return $lastCompleteRound;
|
||||
}
|
||||
|
||||
public static function getFirstIncompleteRound() {
|
||||
$season_id = Season::getCurrent()->id;
|
||||
$rounds = Round::where('season_id','=',$season_id)->orderBy('id')->get();
|
||||
foreach($rounds as $round) {
|
||||
$games = Game::where('round_id','=',$round->id);
|
||||
foreach ($games as $game) {
|
||||
if ($game->score1 == -1 || $game->score2 == -1) {
|
||||
return $round->id;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static function getLastLockedRoundId() {
|
||||
$season = Season::getCurrent();
|
||||
$rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue