diff --git a/app/Console/Commands/TabulateWinners.php b/app/Console/Commands/TabulateWinners.php index 2239c81..a403cec 100644 --- a/app/Console/Commands/TabulateWinners.php +++ b/app/Console/Commands/TabulateWinners.php @@ -118,36 +118,36 @@ class TabulateWinners extends Command return $zeroTo43Query->vehicle; } - function fortyThreeToSixtyEightWinner() + function fortyThreeToSixtySevenWinner() { - $fortyThreeToSixtyEightQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id') + $fortyThreeToSixtySevenQuery = 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', '>=', 1943) - ->where('vehicles.year', '<=', 1968) + ->where('vehicles.year', '<=', 1967) ->where('vehicles.doNotJudge', '=', 0) ->orderBy('totalscore','desc') ->first(); - return $fortyThreeToSixtyEightQuery->vehicle; + return $fortyThreeToSixtySevenQuery->vehicle; } - function sixtyNineToNinetyEightWinner() + function sixtyEightToNinetyEightWinner() { - $sixtyNineToNinetyEightQuery = 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', '>=', 1969) + ->where('vehicles.year', '>=', 1968) ->where('vehicles.year', '<=', 1998) ->where('vehicles.doNotJudge', '=', 0) ->orderBy('totalscore','desc') ->first(); - return $sixtyNineToNinetyEightQuery->vehicle; + return $sixtyEightToNinetyEightQuery->vehicle; } function NinetyNineToCurrentWinner() @@ -226,7 +226,7 @@ class TabulateWinners extends Command 'place' => 'first' ], [ - 'vehicle' => fortyThreeToSixtyEightWinner() + 'vehicle' => fortyThreeToSixtySevenWinner() ] ); CarShowWinner::updateOrCreate( @@ -235,7 +235,7 @@ class TabulateWinners extends Command 'place' => 'second' ], [ - 'vehicle' => fortyThreeToSixtyEightWinner() + 'vehicle' => fortyThreeToSixtySevenWinner() ] ); CarShowWinner::updateOrCreate( @@ -244,7 +244,7 @@ class TabulateWinners extends Command 'place' => 'third' ], [ - 'vehicle' => fortyThreeToSixtyEightWinner() + 'vehicle' => fortyThreeToSixtySevenWinner() ] ); @@ -255,7 +255,7 @@ class TabulateWinners extends Command 'place' => 'first' ], [ - 'vehicle' => sixtyNineToNinetyEightWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] ); CarShowWinner::updateOrCreate( @@ -264,7 +264,7 @@ class TabulateWinners extends Command 'place' => 'second' ], [ - 'vehicle' => sixtyNineToNinetyEightWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] ); CarShowWinner::updateOrCreate( @@ -273,7 +273,7 @@ class TabulateWinners extends Command 'place' => 'third' ], [ - 'vehicle' => sixtyNineToNinetyEightWinner() + 'vehicle' => sixtyEightToNinetyEightWinner() ] );