past contracts for nav bar on admin dashboard menu
This commit is contained in:
@@ -38,20 +38,7 @@ class ContractAdminController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function displayPastContracts() {
|
public function displayPastContracts() {
|
||||||
$contracts = Contract::where(['finished' => true])->where('updated_at', '>', Carbon::now()->subMonths(2))->get()->toArray();
|
$contractsTemp = Contract::where(['finished' => true])->where('updated_at', '>', Carbon::now()->subMonths(2))->get();
|
||||||
|
|
||||||
//Get the accepted bid for the contract and load it into the array
|
|
||||||
foreach($contracts as $contract) {
|
|
||||||
//Get the accepted bid for the contract and add it to the array
|
|
||||||
$accepted = AcceptedBid::where([
|
|
||||||
'contract_id' => $contract['contract_id'],
|
|
||||||
])->get();
|
|
||||||
|
|
||||||
$contract['accepted'] = $accepted->bid_amount;
|
|
||||||
$contract['accepted_notes'] = $accepted->notes;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd($contracts);
|
|
||||||
|
|
||||||
return view('contracts.admin.past')->with('contracts', $contracts);
|
return view('contracts.admin.past')->with('contracts', $contracts);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,7 @@
|
|||||||
End Date: {{ $contract['end_date'] }}
|
End Date: {{ $contract['end_date'] }}
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
Accepted Bid Amount: {{ $contract['accepted']['bid_amount'] }}<br>
|
Final Cost: {{ $contract['final_cost'] }}<br>
|
||||||
</div>
|
|
||||||
<div class="container">
|
|
||||||
Accepted Bid Notes: {{ $contract['accepted']['notes'] }}
|
|
||||||
</div>
|
</div>
|
||||||
<span class="border-dark">
|
<span class="border-dark">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
Reference in New Issue
Block a user