Roundmail::checkReminder automailing system

This commit is contained in:
Torsten 2017-08-28 16:34:19 +02:00
parent 6aad1a7ab2
commit 1f5e056b7f
18 changed files with 269 additions and 116 deletions

View file

@ -18,11 +18,12 @@ class Game extends Model
$game = Game::find($game_id);
$now = Carbon\Carbon::now();
$tipp_input_end = Carbon\Carbon::parse($game->kickoff)->addHour(-1);
$tipp_input_end = $game->getLocktime($game);
return ($tipp_input_end <= $now);
}
public function hasResult() {
$game = $this;
@ -30,6 +31,7 @@ class Game extends Model
}
public static function has_result($game_id) {
$game = Game::where('id',$game_id)->first();
@ -61,4 +63,11 @@ class Game extends Model
}
public function getLocktime() {
return Carbon\Carbon::parse($this->kickoff)->addHour(-1);
}
}