forked from TFMM/silent-auction
feat: show bidder and vehicle details in carshowscores view
This commit is contained in:
@@ -529,7 +529,7 @@ class PagesController extends Controller
|
|||||||
}
|
}
|
||||||
public function showscores()
|
public function showscores()
|
||||||
{
|
{
|
||||||
$carshowscore_results = VehicleScores::with(['scoredVehicle'])
|
$carshowscore_results = VehicleScores::with(['scoredVehicle', 'scoredVehicle.vehicleOwner'])
|
||||||
->groupBy('vehicle')
|
->groupBy('vehicle')
|
||||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||||
->orderBy('totalscore', 'desc')
|
->orderBy('totalscore', 'desc')
|
||||||
@@ -538,7 +538,7 @@ class PagesController extends Controller
|
|||||||
}
|
}
|
||||||
public function showscoresbycar()
|
public function showscoresbycar()
|
||||||
{
|
{
|
||||||
$carshowscore2_results = VehicleScores::with(['scoredVehicle'])
|
$carshowscore2_results = VehicleScores::with(['scoredVehicle', 'scoredVehicle.vehicleOwner'])
|
||||||
->groupBy('vehicle')
|
->groupBy('vehicle')
|
||||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||||
//->orderBy('scoredVehicle.vehicleOwner.bidder_assigned_number')
|
//->orderBy('scoredVehicle.vehicleOwner.bidder_assigned_number')
|
||||||
|
|||||||
@@ -20,14 +20,22 @@
|
|||||||
<table class="table table-vcenter card-table">
|
<table class="table table-vcenter card-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Vehicle Name</th>
|
<th>#</th>
|
||||||
|
<th>Owner</th>
|
||||||
|
<th>Year</th>
|
||||||
|
<th>Make</th>
|
||||||
|
<th>Model</th>
|
||||||
<th>Total Score</th>
|
<th>Total Score</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($scores_results as $score)
|
@foreach($scores_results as $score)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $score->scoredVehicle->make }} {{ $score->scoredVehicle->model }}</td>
|
<td>{{ $score->scoredVehicle->owner }}</td>
|
||||||
|
<td>{{ $score->scoredVehicle->vehicleOwner->bidder_fname ?? '' }} {{ $score->scoredVehicle->vehicleOwner->bidder_lname ?? '' }}</td>
|
||||||
|
<td>{{ $score->scoredVehicle->year }}</td>
|
||||||
|
<td>{{ $score->scoredVehicle->make }}</td>
|
||||||
|
<td>{{ $score->scoredVehicle->model }}</td>
|
||||||
<td>{{ $score->totalscore }}</td>
|
<td>{{ $score->totalscore }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
Reference in New Issue
Block a user