This commit is contained in:
Russ Long 2024-05-08 19:25:39 -04:00
parent 4bdf14de83
commit 9e65a3731c

View File

@ -134,9 +134,9 @@ class TabulateWinners extends Command
return $fortyThreeToSixtyEightQuery->vehicle; return $fortyThreeToSixtyEightQuery->vehicle;
} }
function sixtyEightToNinetyEightWinner() function sixtyNineToNinetyEightWinner()
{ {
$sixtyEightToNinetyEightQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') $sixtyNineToNinetyEightQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id') ->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore') ->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){ ->whereNotIn('vehicle_scores.vehicle', function($query){
@ -147,7 +147,7 @@ class TabulateWinners extends Command
->where('vehicles.doNotJudge', '=', 0) ->where('vehicles.doNotJudge', '=', 0)
->orderBy('totalscore','desc') ->orderBy('totalscore','desc')
->first(); ->first();
return $sixtyEightToNinetyEightQuery->vehicle; return $sixtyNineToNinetyEightQuery->vehicle;
} }
function NinetyNineToCurrentWinner() function NinetyNineToCurrentWinner()
@ -255,7 +255,7 @@ class TabulateWinners extends Command
'place' => 'first' 'place' => 'first'
], ],
[ [
'vehicle' => sixtyEightToNinetyEightWinner() 'vehicle' => sixtyNineToNinetyEightWinner()
] ]
); );
CarShowWinner::updateOrCreate( CarShowWinner::updateOrCreate(
@ -264,7 +264,7 @@ class TabulateWinners extends Command
'place' => 'second' 'place' => 'second'
], ],
[ [
'vehicle' => sixtyEightToNinetyEightWinner() 'vehicle' => sixtyNineToNinetyEightWinner()
] ]
); );
CarShowWinner::updateOrCreate( CarShowWinner::updateOrCreate(
@ -273,7 +273,7 @@ class TabulateWinners extends Command
'place' => 'third' 'place' => 'third'
], ],
[ [
'vehicle' => sixtyEightToNinetyEightWinner() 'vehicle' => sixtyNineToNinetyEightWinner()
] ]
); );