supply chain controller
This commit is contained in:
@@ -318,6 +318,7 @@ class SupplyChainController extends Controller
|
|||||||
'contract_id' => $request->contract_id,
|
'contract_id' => $request->contract_id,
|
||||||
])->select('bids')->first();
|
])->select('bids')->first();
|
||||||
|
|
||||||
|
//Increment the number of bids
|
||||||
$numBids = $num->bid + 1;
|
$numBids = $num->bid + 1;
|
||||||
|
|
||||||
//Update the database
|
//Update the database
|
||||||
@@ -355,14 +356,15 @@ class SupplyChainController extends Controller
|
|||||||
|
|
||||||
//Update the database entry for the supply chain contract bid number
|
//Update the database entry for the supply chain contract bid number
|
||||||
$num = SupplyChainContract::where([
|
$num = SupplyChainContract::where([
|
||||||
'contract_id' => $request->contract_id,
|
'contract_id' => $contractId,
|
||||||
])->select('bids')->first();
|
])->select('bids')->first();
|
||||||
|
|
||||||
|
//Decrement the number of bids
|
||||||
$numBids = $num->bid - 1;
|
$numBids = $num->bid - 1;
|
||||||
|
|
||||||
//Update the database
|
//Update the database
|
||||||
SupplyChainContract::where([
|
SupplyChainContract::where([
|
||||||
'contract_id' => $request->contract_id,
|
'contract_id' => $contractId,
|
||||||
])->update([
|
])->update([
|
||||||
'bids' => $numBids,
|
'bids' => $numBids,
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user