Updating repo for cross-computer work

This commit is contained in:
Torsten 2020-01-17 09:32:06 +01:00
parent 807cf49bc0
commit 1fea0f4fe7
18 changed files with 87847 additions and 5202 deletions

View file

@ -10,7 +10,7 @@ use \App\Leagues\League;
class Season extends Model
{
protected $fillable = [
'name','rounds'
'name','rounds',"max_identical_jokertipps"
];
/*
public function isActive() {
@ -89,4 +89,32 @@ class Season extends Model
return $quota>0;
}
// implemented 2020-01-08 because of needed first round_id of the season
public static function getFirstRoundId($seasonId=-1) {
$season=null;
if ($seasonId==-1) {
$season = Season::getCurrent();
} else {
$season = Season::where('id','=',$seasonId)->first();
}
if (!$season) return -1;
$seasonId=$season->id;
$firstRound = Round::where('season_id','=',$seasonId)->orderBy('id')->first();
return $firstRound->id;
}
public static function maxIdenticalJokertipps($seasonId=-1) {
$season=null;
if ($seasonId==-1) {
$season = Season::getCurrent();
} else {
$season = Season::where('id','=',$seasonId)->first();
}
return $season->max_identical_jokertipps;
}
}