First version of LeagueSwap

This commit is contained in:
Torsten 2022-06-12 00:22:19 +02:00
parent 07ce7961c9
commit 8cc4e620ec
5 changed files with 78 additions and 23 deletions

View file

@ -58,6 +58,16 @@ class League extends Model
return $leagueNames;
}
public static function getIds() {
$season = Season::getCurrent();
$leagues = League::where('season_id','=',$season->id)->get();
$leagueIds = array();
foreach($leagues as $league) {
$leagueIds[]=$league->id; // push id onto array
}
return $leagueIds;
}
public static function getStartRoundId($leagueId)
{
$league = League::where('id','=',$leagueId)->first();
@ -368,23 +378,6 @@ class League extends Model
usort($totalRanking, array('App\Leagues\League','cmpScore'));
}
// HACK TO BE REMOVED: SET POSITIONS MANUALLY 2018-08
/*
foreach ($totalRanking as $index => $entry) {
$uid=$totalRanking[$index][0];
if ($uid==65 or $uid==80 or $uid==84 or $uid==3) {
$totalRanking[$index][4]=3;
}
if ($uid==68 or $uid==32 or $uid==9 or $uid==74) {
$totalRanking[$index][4]=2;
}
}
usort($totalRanking, array('App\Leagues\League','cmpScore'));
*/
// END OF HACK
Log::info($a->getEndMessage());
//error_log($a->getEndMessage());