Payout bugfix

This commit is contained in:
Torsten 2017-11-10 15:32:54 +01:00
parent 922db48c36
commit 622ecaf97c
8 changed files with 73 additions and 54 deletions

View file

@ -156,6 +156,21 @@ class Round extends Model
return null;
}
public static function getCount($seasonId=-1) {
$season=null;
if ($seasonId==-1) {
$season=Season::getCurrent();
} else {
$season=Season::where('id','=', $seasonId)->first();
}
if (!$season) return 0;
$rounds=Round::where('season_id','=',$season->id)->get();
return sizeof($rounds);
}
// TODO: CHeck : Unused ??
public static function getClosestRoundToNow() {
$sql="select round_id,DATEDIFF(NOW(),kickoff) from games order by 2 desc limit 1;";