From 99f63627b2908c1d077494f5c6f3c4af6b597551 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 7 Aug 2020 14:21:40 -0500 Subject: [PATCH] supply chain controller --- app/Http/Controllers/Contracts/SupplyChainController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Contracts/SupplyChainController.php b/app/Http/Controllers/Contracts/SupplyChainController.php index 07518d31e..4d0f2c32b 100644 --- a/app/Http/Controllers/Contracts/SupplyChainController.php +++ b/app/Http/Controllers/Contracts/SupplyChainController.php @@ -318,6 +318,7 @@ class SupplyChainController extends Controller 'contract_id' => $request->contract_id, ])->select('bids')->first(); + //Increment the number of bids $numBids = $num->bid + 1; //Update the database @@ -355,14 +356,15 @@ class SupplyChainController extends Controller //Update the database entry for the supply chain contract bid number $num = SupplyChainContract::where([ - 'contract_id' => $request->contract_id, + 'contract_id' => $contractId, ])->select('bids')->first(); + //Decrement the number of bids $numBids = $num->bid - 1; //Update the database SupplyChainContract::where([ - 'contract_id' => $request->contract_id, + 'contract_id' => $contractId, ])->update([ 'bids' => $numBids, ]);