Show all player leagues in 1 view, reduce nav Dropdown meny item count
This commit is contained in:
parent
02329d5c21
commit
c337916a3b
9 changed files with 93 additions and 47 deletions
|
|
@ -49,11 +49,27 @@ 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;
|
||||
public static function hasQualifications($seasonId=-1) {
|
||||
return Season::hasLeagueType($seasonId,League::RANK_QUALIFICATION);
|
||||
}
|
||||
|
||||
public static function hasStandardLeague($seasonId=-1) {
|
||||
return Season::hasLeagueType($seasonId,League::RANK_LEAGUE1);
|
||||
}
|
||||
|
||||
public static function hasLeagueType($seasonId=-1, $ltype) {
|
||||
$season=null;
|
||||
if ($seasonId==-1) {
|
||||
$season = Season::getCurrent();
|
||||
if (!$season) return false;
|
||||
$seasonId=$season->id;
|
||||
}
|
||||
$leagues = League::where('season_id', '=', $seasonId)->get();
|
||||
foreach ($leagues as $league) {
|
||||
if ($league->rank == $ltype) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue