Arbeit an Auf/Abstieg
This commit is contained in:
parent
5515e13f02
commit
d8a7f78cbd
7 changed files with 61 additions and 52 deletions
|
|
@ -5,6 +5,7 @@ namespace App;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use \App\Setting;
|
||||
use Log;
|
||||
use \App\Leagues\League;
|
||||
|
||||
class Season extends Model
|
||||
{
|
||||
|
|
@ -31,9 +32,7 @@ class Season extends Model
|
|||
return $currentSeason;
|
||||
}
|
||||
|
||||
|
||||
public static function setCurrent($season_id) {
|
||||
|
||||
$setting = Setting::all()->first();
|
||||
if (!$setting) {
|
||||
$setting = Setting::create([
|
||||
|
|
@ -50,4 +49,11 @@ class Season extends Model
|
|||
return $seasons[1];
|
||||
}
|
||||
|
||||
public static function hasQualifications($seasonId) {
|
||||
$leagues = League::where('season_id','=',$seasonId)->get();
|
||||
foreach($leagues as $league) {
|
||||
if ($league->rank == League::RANK_QUALIFICATION) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue