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()
|
||||
{
|
||||
$carshowscore_results = VehicleScores::with(['scoredVehicle'])
|
||||
$carshowscore_results = VehicleScores::with(['scoredVehicle', 'scoredVehicle.vehicleOwner'])
|
||||
->groupBy('vehicle')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->orderBy('totalscore', 'desc')
|
||||
@@ -538,7 +538,7 @@ class PagesController extends Controller
|
||||
}
|
||||
public function showscoresbycar()
|
||||
{
|
||||
$carshowscore2_results = VehicleScores::with(['scoredVehicle'])
|
||||
$carshowscore2_results = VehicleScores::with(['scoredVehicle', 'scoredVehicle.vehicleOwner'])
|
||||
->groupBy('vehicle')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
//->orderBy('scoredVehicle.vehicleOwner.bidder_assigned_number')
|
||||
|
||||
@@ -20,14 +20,22 @@
|
||||
<table class="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Vehicle Name</th>
|
||||
<th>#</th>
|
||||
<th>Owner</th>
|
||||
<th>Year</th>
|
||||
<th>Make</th>
|
||||
<th>Model</th>
|
||||
<th>Total Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($scores_results as $score)
|
||||
<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>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user