...
This commit is contained in:
parent
ed0c445bfa
commit
30f6157606
15 changed files with 248 additions and 169 deletions
|
|
@ -18,24 +18,17 @@ class SeasonsController extends Controller
|
|||
{
|
||||
public function index() {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
$seasons = DB::table('seasons')->get();
|
||||
|
||||
|
||||
$currentSeason=Season::getCurrent();
|
||||
|
||||
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
if (!$quotas) {
|
||||
Quota::createDefaultQuota($currentSeason->id);
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
}
|
||||
|
||||
$active_user_count = sizeof( User::getActives() );
|
||||
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
$payouts = Quota::getPayouts($currentSeason->id);
|
||||
|
||||
$currentSeasonId=-1;
|
||||
if ($currentSeason) {
|
||||
$quotas = Quota::getQuotas($currentSeason->id);
|
||||
$payouts = Quota::getPayouts($currentSeason->id);
|
||||
}
|
||||
|
||||
return view('seasons.index', compact('seasons','currentSeason','active_user_count','quotas','payouts'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue