Rewrite tabulation #14
|
|
@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
|
|||
use App\Models\Audition;
|
||||
use App\Models\Entry;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class AdvancementController extends Controller
|
||||
{
|
||||
|
|
@ -57,7 +58,7 @@ class AdvancementController extends Controller
|
|||
$entries->load('advancementVotes');
|
||||
|
||||
$scoringComplete = $entries->every(function ($entry) {
|
||||
return $entry->scoring_complete;
|
||||
return $entry->score_totals[0] >= 0;
|
||||
});
|
||||
|
||||
return view('tabulation.advancement.ranking', compact('audition', 'entries', 'scoringComplete'));
|
||||
|
|
@ -72,7 +73,7 @@ class AdvancementController extends Controller
|
|||
foreach ($entries as $entry) {
|
||||
$entry->addFlag('will_advance');
|
||||
}
|
||||
|
||||
Cache::forget('audition'.$audition->id.'advancement');
|
||||
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
||||
'Passers have been set successfully');
|
||||
}
|
||||
|
|
@ -83,7 +84,7 @@ class AdvancementController extends Controller
|
|||
foreach ($audition->entries as $entry) {
|
||||
$entry->removeFlag('will_advance');
|
||||
}
|
||||
|
||||
Cache::forget('audition'.$audition->id.'advancement');
|
||||
return redirect()->route('advancement.ranking', ['audition' => $audition->id])->with('success',
|
||||
'Passers have been cleared successfully');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue