update
This commit is contained in:
@@ -448,11 +448,13 @@ class LelongController extends Controller
|
||||
$lelongbid = LelongBid::where('lelong_id','=',$id)->get();
|
||||
foreach($lelongbid as $bid)
|
||||
{
|
||||
$highestprice = LelongBidder::where('lelongbid_id','=',$bid->id)->orderByRaw('lelongbidder.hargabida DESC' )->get();
|
||||
$highestprice = LelongBidder::where('lelongbid_id','=',139)->orderBy('lelongbidder.hargabida','DESC' )->first();
|
||||
// dd($highestprice->hargabida);
|
||||
if($highestprice)
|
||||
{
|
||||
foreach($highestprice as $price){
|
||||
$bidders = LelongBidder::where('hargabida','=',$price->hargabida)->MIN('lelongbidder.masa_bidaan' )->get();
|
||||
// foreach($highestprice as $price){
|
||||
$bidders = LelongBidder::where('lelongbid_id','=',139)->where('hargabida','=',$highestprice->hargabida)->orderBy('masa_bidaan','ASC' )->get();
|
||||
// dd($bidders);
|
||||
$count = 0;
|
||||
foreach($bidders as $bidder)
|
||||
{
|
||||
@@ -460,11 +462,12 @@ class LelongController extends Controller
|
||||
if($count == 1)
|
||||
{
|
||||
$pemenang = LelongBidder::where('id','=',$bidder->id)
|
||||
->first();
|
||||
->first();
|
||||
$pemenang->status_bidder = 1;
|
||||
$pemenang->save();
|
||||
|
||||
|
||||
$updatebid = LelongBid::where('id','=',$bid->id)->first();
|
||||
// dd($updatebid);
|
||||
$updatebid->hargajual = $bidder->hargabida;
|
||||
$updatebid->nopembeli = $bidder->user_id;
|
||||
$updatebid->status_jual = 1;
|
||||
@@ -501,7 +504,7 @@ class LelongController extends Controller
|
||||
$kalah->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user