diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index eb1df11..425628a 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -336,12 +336,10 @@ class PagesController extends Controller public function winningbidderlist() { - $winnerlist_results = DB::select("SELECT - winning_bidder_num - FROM winning_bids - GROUP BY winning_bidder_num - ORDER BY winning_bidder_num - "); + $winnerlist_results = WinningBids::join('bidders', 'winning_bids.winning_bidder_num', '=', 'bidders.idbidders') + ->groupBy('winning_bidder_num') + ->orderBy('bidders.bidder_assigned_number') + ->get(); return view('winningbidderlist', ['winnerlist_results' => $winnerlist_results]); } } diff --git a/resources/views/winningbidderlist.blade.php b/resources/views/winningbidderlist.blade.php index 3867544..28f2b94 100644 --- a/resources/views/winningbidderlist.blade.php +++ b/resources/views/winningbidderlist.blade.php @@ -17,7 +17,7 @@ // start first row echo ""; foreach($winnerlist_results as $winnerlist_result){ - echo "

" . $winnerlist_result->winning_bidder_num . "

"; + echo "

" . $winnerlist_result->bidders->bidder_assigned_number . "

"; // do we need a new row? if($i % 8 === 0){ echo "";