Remove director results for optimization
This commit is contained in:
parent
ada3865f6a
commit
fe72d148e9
|
|
@ -31,27 +31,28 @@ class DashboardController extends Controller
|
|||
GetEntrySeatingResult $resultGenerator,
|
||||
RankAuditionEntries $ranker
|
||||
) {
|
||||
$entries = Auth::user()->entries;
|
||||
$entries = $entries->filter(function ($entry) {
|
||||
return $entry->audition->hasFlag('seats_published');
|
||||
});
|
||||
$entries = $entries->sortBy(function ($entry) {
|
||||
return $entry->student->full_name(true);
|
||||
});
|
||||
$scores = [];
|
||||
$results = [];
|
||||
$ranks = [];
|
||||
foreach ($entries as $entry) {
|
||||
$results[$entry->id] = $resultGenerator->getResult($entry);
|
||||
if (! $entry->hasFlag('no_show') && ! $entry->hasFlag('failed_prelim')) {
|
||||
$scores[$entry->id] = $scoreCalc->calculate('seating', $entry);
|
||||
$auditionResults = $ranker->rank('seating', $entry->audition);
|
||||
$ranks[$entry->id] = $auditionResults->firstWhere('id', $entry->id)->raw_rank;
|
||||
}
|
||||
}
|
||||
$showRecapLink = AuditionFlag::where('flag_name', 'seats_published')->count() > 0;
|
||||
|
||||
return view('dashboard.dashboard', compact('entries', 'scores', 'results', 'ranks', 'showRecapLink'));
|
||||
// $entries = Auth::user()->entries;
|
||||
// $entries = $entries->filter(function ($entry) {
|
||||
// return $entry->audition->hasFlag('seats_published');
|
||||
// });
|
||||
// $entries = $entries->sortBy(function ($entry) {
|
||||
// return $entry->student->full_name(true);
|
||||
// });
|
||||
// $scores = [];
|
||||
// $results = [];
|
||||
// $ranks = [];
|
||||
// foreach ($entries as $entry) {
|
||||
// $results[$entry->id] = $resultGenerator->getResult($entry);
|
||||
// if (! $entry->hasFlag('no_show') && ! $entry->hasFlag('failed_prelim')) {
|
||||
// $scores[$entry->id] = $scoreCalc->calculate('seating', $entry);
|
||||
// $auditionResults = $ranker->rank('seating', $entry->audition);
|
||||
// $ranks[$entry->id] = $auditionResults->firstWhere('id', $entry->id)->raw_rank;
|
||||
// }
|
||||
// }
|
||||
// $showRecapLink = AuditionFlag::where('flag_name', 'seats_published')->count() > 0;
|
||||
//
|
||||
// return view('dashboard.dashboard', compact('entries', 'scores', 'results', 'ranks', 'showRecapLink'));
|
||||
return view('dashboard.dashboard');
|
||||
}
|
||||
|
||||
public function my_school()
|
||||
|
|
|
|||
|
|
@ -27,24 +27,24 @@
|
|||
</x-card.list.row>
|
||||
</a>
|
||||
@endif
|
||||
@if($showRecapLink)
|
||||
<a href="{{ route('recap.selectAudition') }}">
|
||||
<x-card.list.row class="hover:bg-gray-200">
|
||||
Audition Score Recaps
|
||||
</x-card.list.row>
|
||||
</a>
|
||||
@endif
|
||||
{{-- @if($showRecapLink)--}}
|
||||
{{-- <a href="{{ route('recap.selectAudition') }}">--}}
|
||||
{{-- <x-card.list.row class="hover:bg-gray-200">--}}
|
||||
{{-- Audition Score Recaps--}}
|
||||
{{-- </x-card.list.row>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- @endif--}}
|
||||
</x-card.list.body>
|
||||
</x-card.card>
|
||||
</div>
|
||||
@if(Auth::user()->school_id)
|
||||
<div class="md:col-span-3 pl-3">{{-- Column 2 Results --}}
|
||||
<x-card.card>
|
||||
<x-card.heading>My Results</x-card.heading>
|
||||
@include('dashboard.results-table')
|
||||
</x-card.card>
|
||||
</div>
|
||||
@endif
|
||||
{{-- @if(Auth::user()->school_id)--}}
|
||||
{{-- <div class="md:col-span-3 pl-3">--}}{{-- Column 2 Results --}}
|
||||
{{-- <x-card.card>--}}
|
||||
{{-- <x-card.heading>My Results</x-card.heading>--}}
|
||||
{{-- @include('dashboard.results-table')--}}
|
||||
{{-- </x-card.card>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
<div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue