diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index f018de8..3d64f93 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -216,9 +216,16 @@ class PagesController extends Controller $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid) ->first(); $bidder_num = $checkout_final_results->bidder_num; - $checkout_list_results = WinningBids::with('items_rel') - ->where('winning_bidder_num', '=', $bidder_num) - ->get(); + $checkout_list_results = DB::select("SELECT + *, items.item_assigned_num, items.item_desc + FROM winning_bids + INNER JOIN items AS items + ON winning_bids.winning_item_num=items.iditems + WHERE winning_bidder_num = $bidder_num + "); + WinningBids::with('items') + ->where('winning_bidder_num', '=', '$bidder_num') + ->get(); $checkout_info_results = DB::select("SELECT winning_bids.*, bidders.*, diff --git a/app/Models/WinningBids.php b/app/Models/WinningBids.php index 0abc95c..6cf890a 100644 --- a/app/Models/WinningBids.php +++ b/app/Models/WinningBids.php @@ -20,7 +20,7 @@ class WinningBids extends Model 'updated_at' ]; - public function items_rel() + public function items() { return $this->hasMany('App\Models\Items', 'iditems', 'winning_item_num'); } diff --git a/resources/views/receiptpdf.blade.php b/resources/views/receiptpdf.blade.php index 9529157..2238f4d 100644 --- a/resources/views/receiptpdf.blade.php +++ b/resources/views/receiptpdf.blade.php @@ -84,10 +84,10 @@ @foreach($checkout_list_results as $checkout_list_result)