Payout bugfix
This commit is contained in:
parent
922db48c36
commit
622ecaf97c
8 changed files with 73 additions and 54 deletions
|
|
@ -88,7 +88,7 @@ class LeaguesController extends Controller
|
|||
|
||||
$roundNames = Round::getNames();
|
||||
$leagueNames = League::getNames();
|
||||
$leagues = League::where('season_id','=',$season->id)->where('rank','<', 4)->orderBy('id')->get();
|
||||
$leagues = League::where('season_id','=',$season->id)->where('rank','<=', 4)->orderBy('id')->get();
|
||||
$matchesTotal = array();
|
||||
|
||||
foreach ($leagues as $league) {
|
||||
|
|
@ -114,6 +114,9 @@ class LeaguesController extends Controller
|
|||
//$leagues = array_reverse(League::getRanking($rank));
|
||||
$leagueNames = League::getNames();
|
||||
$userNames = User::getNames();
|
||||
|
||||
$leagues = League::where('season_id','=',$season->id)->where('rank','<=', 4)->orderBy('id')->get();
|
||||
if (!sizeof($leagues)) return redirect("/");
|
||||
|
||||
$totalRanking = League::getTotalRankingOverall(); // Nur für Auf/Abstiegsinfo benötigt.
|
||||
$rankInfo=array();
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ class RoundsController extends Controller
|
|||
$rounds = Round::all()->where('season_id', '=', $activeSeasonId);
|
||||
}
|
||||
|
||||
$quotas = Quota::getQuotas($activeSeason->id);
|
||||
$round_count = $quotas['Runden'];
|
||||
$quotas = Quota::getQuotas();
|
||||
$round_count = Round::getCount();
|
||||
|
||||
return view('rounds.index', compact('rounds','activeSeason', 'round_count'));
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class SeasonsController extends Controller
|
|||
|
||||
$currentSeasonId=-1;
|
||||
if ($currentSeason) {
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
$payouts = Quota::getPayouts($currentSeason->id);
|
||||
$quotas = Quota::getQuotas();
|
||||
$payouts = Quota::getPayouts();
|
||||
}
|
||||
|
||||
return view('seasons.index', compact('seasons','currentSeason','active_user_count','quotas','payouts'));
|
||||
|
|
@ -60,7 +60,7 @@ class SeasonsController extends Controller
|
|||
Season::setCurrent($season->id);
|
||||
Log::info('Setting season id=' .$season->id);
|
||||
|
||||
Quota::createDefaultQuota($season->id);
|
||||
Quota::createDefaultQuota();
|
||||
|
||||
$nr=1;
|
||||
$roundcount=request('roundcount');
|
||||
|
|
@ -155,26 +155,26 @@ class SeasonsController extends Controller
|
|||
|
||||
// Create and save the season
|
||||
|
||||
Quota::setQuota('Runden',request('round_count'), $currentSeason->id);
|
||||
Quota::setQuota('Einsatz',request('einsatz'), $currentSeason->id);
|
||||
Quota::setQuota('Tagessieg',request('tagessieg'), $currentSeason->id);
|
||||
Quota::setQuota('Gruenes Trikot',request('gruenes_trikot'), $currentSeason->id);
|
||||
Quota::setQuota('Pokal',request('pokal'), $currentSeason->id);
|
||||
Quota::setQuota('Platzierung',request('platzierung'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 1',request('platz1'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 2',request('platz2'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 3',request('platz3'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 4',request('platz4'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 5',request('platz5'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 6',request('platz6'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 7',request('platz7'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 8',request('platz8'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 9',request('platz9'), $currentSeason->id);
|
||||
Quota::setQuota('Platz 10',request('platz10'), $currentSeason->id);
|
||||
Quota::setQuota('Liga-Wertung',request('liga'), $currentSeason->id);
|
||||
Quota::setQuota('Liga Platz 1',request('liga_platz1'), $currentSeason->id);
|
||||
Quota::setQuota('Liga Platz 2',request('liga_platz2'), $currentSeason->id);
|
||||
Quota::setQuota('Liga Platz 3',request('liga_platz3'), $currentSeason->id);
|
||||
Quota::setQuota('Runden', request('round_count'));
|
||||
Quota::setQuota('Einsatz', request('einsatz'));
|
||||
Quota::setQuota('Tagessieg', request('tagessieg'));
|
||||
Quota::setQuota('Gruenes Trikot', request('gruenes_trikot'));
|
||||
Quota::setQuota('Pokal', request('pokal'));
|
||||
Quota::setQuota('Platzierung', request('platzierung'));
|
||||
Quota::setQuota('Platz 1', request('platz1'));
|
||||
Quota::setQuota('Platz 2', request('platz2'));
|
||||
Quota::setQuota('Platz 3', request('platz3'));
|
||||
Quota::setQuota('Platz 4', request('platz4'));
|
||||
Quota::setQuota('Platz 5', request('platz5'));
|
||||
Quota::setQuota('Platz 6', request('platz6'));
|
||||
Quota::setQuota('Platz 7', request('platz7'));
|
||||
Quota::setQuota('Platz 8', request('platz8'));
|
||||
Quota::setQuota('Platz 9', request('platz9'));
|
||||
Quota::setQuota('Platz 10', request('platz10'));
|
||||
Quota::setQuota('Liga-Wertung', request('liga'));
|
||||
Quota::setQuota('Liga Platz 1', request('liga_platz1'));
|
||||
Quota::setQuota('Liga Platz 2', request('liga_platz2'));
|
||||
Quota::setQuota('Liga Platz 3', request('liga_platz3'));
|
||||
|
||||
// Redirect to the home page
|
||||
return redirect('/seasons');
|
||||
|
|
|
|||
|
|
@ -362,8 +362,8 @@ class UsersController extends Controller
|
|||
$currentSeason = Season::getCurrent();
|
||||
|
||||
$active_user_count = sizeof(User::getActives());
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
$payouts = Quota::getPayouts($currentSeason->id);
|
||||
$quotas = Quota::getQuotas();
|
||||
$payouts = Quota::getPayouts();
|
||||
|
||||
return view('users.show_payouts', compact('payouts','active_user_count','quotas','currentSeason'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue