past contracts for nav bar on admin dashboard menu

This commit is contained in:
2020-06-29 00:32:04 -05:00
parent bf5748d58e
commit 9fc304040a
2 changed files with 2 additions and 18 deletions

View File

@@ -38,20 +38,7 @@ class ContractAdminController extends Controller
}
public function displayPastContracts() {
$contracts = Contract::where(['finished' => true])->where('updated_at', '>', Carbon::now()->subMonths(2))->get()->toArray();
//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);
$contractsTemp = Contract::where(['finished' => true])->where('updated_at', '>', Carbon::now()->subMonths(2))->get();
return view('contracts.admin.past')->with('contracts', $contracts);
}

View File

@@ -27,10 +27,7 @@
End Date: {{ $contract['end_date'] }}
</div>
<div class="container">
Accepted Bid Amount: {{ $contract['accepted']['bid_amount'] }}<br>
</div>
<div class="container">
Accepted Bid Notes: {{ $contract['accepted']['notes'] }}
Final Cost: {{ $contract['final_cost'] }}<br>
</div>
<span class="border-dark">
<div class="container">