From 141d6c25fa7f8a98c7b8adf91c178e22cfa38f5e Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sat, 16 Mar 2024 13:39:58 -0400 Subject: [PATCH] adjust year categories --- app/Console/Commands/TabulateWinners.php | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/Console/Commands/TabulateWinners.php b/app/Console/Commands/TabulateWinners.php index 3c52d43..928dd5b 100644 --- a/app/Console/Commands/TabulateWinners.php +++ b/app/Console/Commands/TabulateWinners.php @@ -134,36 +134,36 @@ class TabulateWinners extends Command return $fortyThreeToSixtySevenQuery->vehicle; } - function sixtyEightToNinetySevenWinner() + function sixtyEightToNinetyEightWinner() { - $sixtyEightToNinetySevenQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') + $sixtyEightToNinetyEightQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') ->groupBy('vehicles.id') ->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore') ->whereNotIn('vehicle_scores.vehicle', function($query){ $query->select('vehicle')->from('car_show_winners'); }) - ->where('vehicles.year', '>=', 1968) - ->where('vehicles.year', '<=', 1997) + ->where('vehicles.year', '>=', 1969) + ->where('vehicles.year', '<=', 1998) ->where('vehicles.doNotJudge', '=', 0) ->orderBy('totalscore','desc') ->first(); - return $sixtyEightToNinetySevenQuery->vehicle; + return $sixtyEightToNinetyEightQuery->vehicle; } - function NinetyEightToCurrentWinner() + function NinetyNineToCurrentWinner() { - $NinetyEightToCurrentQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') + $NinetyNineToCurrentQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') ->groupBy('vehicles.id') ->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore') ->whereNotIn('vehicle_scores.vehicle', function($query){ $query->select('vehicle')->from('car_show_winners'); }) - ->where('vehicles.year', '>=', 1998) + ->where('vehicles.year', '>=', 1999) //->where('vehicles.year', '<=', 1997) ->where('vehicles.doNotJudge', '=', 0) ->orderBy('totalscore','desc') ->first(); - return $NinetyEightToCurrentQuery->vehicle; + return $NinetyNineToCurrentQuery->vehicle; } // Truncate table first @@ -255,7 +255,7 @@ class TabulateWinners extends Command 'place' => 'first' ], [ - 'vehicle' => sixtyEightToNinetySevenWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] ); CarShowWinner::updateOrCreate( @@ -264,7 +264,7 @@ class TabulateWinners extends Command 'place' => 'second' ], [ - 'vehicle' => sixtyEightToNinetySevenWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] ); CarShowWinner::updateOrCreate( @@ -273,7 +273,7 @@ class TabulateWinners extends Command 'place' => 'third' ], [ - 'vehicle' => sixtyEightToNinetySevenWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] ); @@ -284,7 +284,7 @@ class TabulateWinners extends Command 'place' => 'first' ], [ - 'vehicle' => NinetyEightToCurrentWinner() + 'vehicle' => NinetyNineToCurrentWinner() ] ); CarShowWinner::updateOrCreate( @@ -293,7 +293,7 @@ class TabulateWinners extends Command 'place' => 'second' ], [ - 'vehicle' => NinetyEightToCurrentWinner() + 'vehicle' => NinetyNineToCurrentWinner() ] ); CarShowWinner::updateOrCreate( @@ -302,7 +302,7 @@ class TabulateWinners extends Command 'place' => 'third' ], [ - 'vehicle' => NinetyEightToCurrentWinner() + 'vehicle' => NinetyNineToCurrentWinner() ] ); }