From 825a1925817ebd8c3f5b758790404382b4b8f50c Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sat, 8 Feb 2020 15:24:15 -0500 Subject: [PATCH] testing --- app/Console/Commands/TabulateWinners.php | 34 +++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/app/Console/Commands/TabulateWinners.php b/app/Console/Commands/TabulateWinners.php index 79074a8..469ccd1 100644 --- a/app/Console/Commands/TabulateWinners.php +++ b/app/Console/Commands/TabulateWinners.php @@ -57,23 +57,8 @@ class TabulateWinners extends Command ->orderBy('totalscore','desc') ->first(); return $mainWinnerQuery->vehicle; - } - /* function categoryWinner($category) - { - $categoryWinnerQuery = 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.doNotJudge', '=', 0) - //->where('vehicles.type', '=', "$category") - ->orderBy('totalscore', 'desc') - ->first(); - return $categoryWinnerQuery->vehicle; - } - -*/ + } + function pcWinner() { $peoplesChoiceWinnerQuery = DB::table('peoples_choice') @@ -190,7 +175,20 @@ class TabulateWinners extends Command ->first(); return $thousandsQuery->vehicle; } - + function categoryWinner($category) + { + $categoryWinnerQuery = 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.doNotJudge', '=', 0) + //->where('vehicles.type', '=', "$category") + ->orderBy('totalscore', 'desc') + ->first(); + return $categoryWinnerQuery->vehicle; + } //categories /* Here for reference only $individuallyProcessedAwards = array(