Fixed rankinglist display ManualPayout, fixed Liga Payout Quota Entry+Storage

This commit is contained in:
Torsten 2018-02-06 08:24:41 +01:00
parent e482986eac
commit def862bc13
3 changed files with 9 additions and 8 deletions

View file

@ -184,10 +184,10 @@ class SeasonsController extends Controller
Quota::setQuota('platz 10', str_replace(",",".",request('platz10'))); Quota::setQuota('platz 10', str_replace(",",".",request('platz10')));
Quota::setQuota('liga', str_replace(",",".",request('liga'))); Quota::setQuota('liga', str_replace(",",".",request('liga')));
Quota::setQuota('liga_platz1', str_replace(",",".",request('liga_platz1'))); Quota::setQuota('liga_platz1', str_replace(",",".",request('liga_platz1')));
Quota::setQuota('liga platz2', str_replace(",",".",request('liga_platz2'))); Quota::setQuota('liga_platz2', str_replace(",",".",request('liga_platz2')));
Quota::setQuota('liga platz3', str_replace(",",".",request('liga_platz3'))); Quota::setQuota('liga_platz3', str_replace(",",".",request('liga_platz3')));
Quota::setQuota('liga platz2_1', str_replace(",",".",request('liga_platz2_1'))); Quota::setQuota('liga_platz2_1', str_replace(",",".",request('liga_platz2_1')));
Quota::setQuota('liga platz3_1', str_replace(",",".",request('liga_platz3_1'))); Quota::setQuota('liga_platz3_1', str_replace(",",".",request('liga_platz3_1')));
// Redirect to the home page // Redirect to the home page
return redirect('/seasons'); return redirect('/seasons');

View file

@ -346,15 +346,17 @@ class UsersController extends Controller
// Add GShirt, Playoff, Pokal payout // Add GShirt, Playoff, Pokal payout
Log::info("!> ".$user_id); Log::info("!> ".$user_id);
$rankingDisplay[$user_id]['gshirt_payout'] = 0; $rankingDisplay[$user_id]['gshirt_payout'] = 0;
$rankingDisplay[$user_id]['pokal'] = 0;Log::info("Setting pokal for user_id ".$user_id); $rankingDisplay[$user_id]['pokal'] = 0;
$rankingDisplay[$user_id]['playoff'] = 0; $rankingDisplay[$user_id]['playoff'] = 0;
$userPayouts = $payoutList[$user_id]; $userPayouts = $payoutList[$user_id];
$hasGreenShirtGame=Season::hasGreenShirtGame(); $hasGreenShirtGame=Season::hasGreenShirtGame();
foreach ($userPayouts as $payoutItem) { foreach ($userPayouts as $payoutItem) {
Log::info($user_id." - ".$payoutItem['roundname']);
if ($hasGreenShirtGame) { if ($hasGreenShirtGame) {
if ($payoutItem['roundname'] == "Grünes Trikot") { if ($payoutItem['roundname'] == "Grünes Trikot") {
$rankingDisplay[$user_id]["gshirt_payout"] = $payoutItem['payout']; $rankingDisplay[$user_id]["gshirt_payout"] = $payoutItem['payout'];
Log::info("GreenShirt goes to: ".$user_id);
} }
} }
if ($payoutItem['roundname'] == 'Pokal') { if ($payoutItem['roundname'] == 'Pokal') {
@ -364,14 +366,13 @@ class UsersController extends Controller
if (strpos($payoutItem['roundname'], 'Liga') !== false) { if (strpos($payoutItem['roundname'], 'Liga') !== false) {
$rankingDisplay[$user_id]["playoff"] = $payoutItem['payout']; $rankingDisplay[$user_id]["playoff"] = $payoutItem['payout'];
Log::info($payoutItem['roundname']." goes to: ".$user_id);
} }
} }
} }
} }
$userids = array_keys($rankingDisplay); $userids = array_keys($rankingDisplay);
$round=Round::where('id','=',$max_round_id)->first(); $round=Round::where('id','=',$max_round_id)->first();
$games=Game::where('round_id','=',$max_round_id)->get(); $games=Game::where('round_id','=',$max_round_id)->get();

View file

@ -402,7 +402,7 @@ class Quota extends Model
$item = array(); $item = array();
$item['roundname']=$names[$quota]; $item['roundname']=$names[$quota];
$item['payout']=$_payouts[$quota]; $item['payout']=$_payouts[$quota];
array_push($payoutList,$item); array_push($payoutList[$uId],$item);
} }
return $payoutList; return $payoutList;