adjust year categories
This commit is contained in:
parent
11ef29d89c
commit
141d6c25fa
@ -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()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user