From 4510f9ab8b7ed7f1409898d4252880dac791db51 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Mon, 24 Dec 2018 13:21:56 -0500 Subject: [PATCH] Convert editwinners and itemlist --- app/Http/Controllers/PagesController.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index b5e6379..83dfdd8 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -158,14 +158,13 @@ class PagesController extends Controller $winning_bid_id = $edit_win_req->winid; $winner_bidder = $edit_win_req->winnerbiddernum; $winner_cost = $edit_win_req->winnerbid; - $winner_insert = DB::table('winning_bids') - ->where('idwinning_bids', $winning_bid_id) - ->update( - [ - 'winning_bidder_num' => $winner_bidder, - 'winning_cost' => $winner_cost - ] - ); + $winner_insert = WinningBids::where('idwinning_bids', $winning_bid_id) + ->update( + [ + 'winning_bidder_num' => $winner_bidder, + 'winning_cost' => $winner_cost + ] + ); return redirect('editwinners'); } @@ -186,11 +185,8 @@ class PagesController extends Controller public function itemlist() { - $itemlist_results = DB::select("SELECT - * - FROM items - ORDER BY item_assigned_num ASC - "); + $itemlist_results = Items::orderBy('item_assigned_num', 'asc') + ->get(); return view('itemlist', ['itemlist_results' => $itemlist_results]); }