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(