lowest bid
This commit is contained in:
@@ -90,6 +90,17 @@ class ContractController extends Controller
|
|||||||
$contracts[$i] = $contractsTemp[$i];
|
$contracts[$i] = $contractsTemp[$i];
|
||||||
$contracts[$i]['bid_count'] = $tempCount;
|
$contracts[$i]['bid_count'] = $tempCount;
|
||||||
$contracts[$i]['bids'] = $bids;
|
$contracts[$i]['bids'] = $bids;
|
||||||
|
foreach($bids as $bid) {
|
||||||
|
if(!isset($contracts[$i]['lowestbid'])) {
|
||||||
|
$contracts[$i]['lowestbid']['amount'] = $bid->amount;
|
||||||
|
$contracts[$i]['lowestbid']['corporation_name'] = $bid->corporation_name;
|
||||||
|
} else {
|
||||||
|
if($bid->amount < $contract[$i]['lowestbid']['amount']) {
|
||||||
|
$contracts[$i]['lowestbid']['amount'] = $bid->amount;
|
||||||
|
$contracts[$i]['lowestbid']['corporation_name'] = $bid->corporation_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Call for the view to be displayed
|
//Call for the view to be displayed
|
||||||
@@ -103,6 +114,7 @@ class ContractController extends Controller
|
|||||||
//Declare our array variables
|
//Declare our array variables
|
||||||
$bids = array();
|
$bids = array();
|
||||||
$contracts = array();
|
$contracts = array();
|
||||||
|
$lowestBid = null;
|
||||||
|
|
||||||
//Calucate today's date to know which contracts to display
|
//Calucate today's date to know which contracts to display
|
||||||
$today = Carbon::now();
|
$today = Carbon::now();
|
||||||
@@ -120,6 +132,15 @@ class ContractController extends Controller
|
|||||||
$contracts[$i] = $contractsTemp[$i];
|
$contracts[$i] = $contractsTemp[$i];
|
||||||
$contracts[$i]['bid_count'] = $tempCount;
|
$contracts[$i]['bid_count'] = $tempCount;
|
||||||
$contracts[$i]['bids'] = $bids;
|
$contracts[$i]['bids'] = $bids;
|
||||||
|
foreach($bids as $bid) {
|
||||||
|
if(!isset($contracts[$i]['lowestbid'])) {
|
||||||
|
$contracts[$i]['lowestbid']['amount'] = $bid->amount;
|
||||||
|
} else {
|
||||||
|
if($bid->amount < $contract[$i]['lowestbid']['amount']) {
|
||||||
|
$contracts[$i]['lowestbid']['amount'] = $bid->amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view ('contracts.privatecontracts')->with('contracts', $contracts);
|
return view ('contracts.privatecontracts')->with('contracts', $contracts);
|
||||||
|
|||||||
@@ -25,7 +25,13 @@
|
|||||||
{{ $contract['body'] }}
|
{{ $contract['body'] }}
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<hr>
|
||||||
|
<span class="border-dark">
|
||||||
|
<div class="container">
|
||||||
|
Lowest Bid: {{ $contract['lowestbid']['amount'] }}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<hr>
|
||||||
@foreach($contract['bids'] as $bid)
|
@foreach($contract['bids'] as $bid)
|
||||||
@if(auth()->user()->character_id == $bid['character_id'])
|
@if(auth()->user()->character_id == $bid['character_id'])
|
||||||
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
|
<a href="/contracts/modify/bid/{{ $bid['id'] }}" class="btn btn-primary" role="button">Modify Bid</a>
|
||||||
|
|||||||
@@ -26,6 +26,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
<hr>
|
<hr>
|
||||||
|
<span class="border-dark">
|
||||||
|
<div class="container">
|
||||||
|
Lowest Bid: {{ $contract['lowestbid']['amount'] }}<br>
|
||||||
|
Lowest Bid Corp: {{ $contract['lowestbid']['corporation_name'] }}<br>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
<hr>
|
||||||
<!-- Count the number of bids for the current contract -->
|
<!-- Count the number of bids for the current contract -->
|
||||||
@if($contract['bid_count'] > 0)
|
@if($contract['bid_count'] > 0)
|
||||||
<span class="border-dark">
|
<span class="border-dark">
|
||||||
|
|||||||
Reference in New Issue
Block a user