Working on Roundmail system
This commit is contained in:
parent
3fa31921f0
commit
6d7ee1a47c
11 changed files with 224 additions and 24 deletions
|
|
@ -130,7 +130,34 @@ class User extends Authenticatable
|
|||
return $dbDate;
|
||||
}
|
||||
|
||||
public function hello() {
|
||||
return "Hello";
|
||||
public static function hasMissingTipp($user_id) {
|
||||
$round_id = Round::getFirstIncompleteRound();
|
||||
$games = Game::where('round_id','=',$round_id);
|
||||
|
||||
foreach ($games as $game) {
|
||||
$tipp = Tipp::where('game_id','=',$game->id)->first();
|
||||
|
||||
if ($tipp->score1 == -1 || $tipp->score2 == -1) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function hasMissingJoker($user_id) {
|
||||
$round_id = Round::getFirstIncompleteRound();
|
||||
$games = Game::where('round_id','=',$round_id);
|
||||
|
||||
$joker=0;
|
||||
foreach ($games as $game) {
|
||||
$tipp = Tipp::where('game_id','=',$game->id)->first();
|
||||
if ($tipp->joker == true) { $joker=1; }
|
||||
}
|
||||
|
||||
if ($joker==1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue