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

@ -37,8 +37,17 @@ class Game extends Model
public static function resultString($game_id) {
$game = Game::where('id',$game_id)->first();
$now=Carbon\Carbon::now();
if (!Game::has_result($game_id)) { return "Anstoss: " . $game->kickoff;}
if (!Game::has_result($game_id)) {
if ($game->kickoff>$now) return "Anstoss: " . $game->kickoff;
$start=Carbon\Carbon::parse($game->kickoff);
$end=$start->addHours(2);
if ($end<$now && $start>$now) return "Läuft";
return "(Eingeben)";
}
return $game->score1. " : " . $game->score2;
}