Update AccountController.php
This commit is contained in:
@@ -124,6 +124,7 @@ class AccountController extends Controller
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
|
||||
$senaraisag = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('payment', 'lelongbidder.payment_id', '=', 'payment.id')
|
||||
->where('lelongbid.lelong_id', $request->lelong_id)
|
||||
@@ -136,27 +137,27 @@ class AccountController extends Controller
|
||||
'lelongbid.lelong_id',
|
||||
'lelongbidder.user_id',
|
||||
)
|
||||
->get();
|
||||
->get();
|
||||
|
||||
$total_payment = 0;
|
||||
foreach($senaraisag as $sag)
|
||||
$paymentid = $senaraisag->groupBy('payment_id');
|
||||
|
||||
foreach($paymentid as $id)
|
||||
{
|
||||
$payment = Payment::where('id', $sag->payment_id)->first();
|
||||
$payment = Payment::where('id', $id->payment_id)->first();
|
||||
$payment->disahkan_oleh = $user->id;
|
||||
$payment->disahkan_pada = $currentdate;
|
||||
$payment->save();
|
||||
|
||||
$total_payment = $total_payment + $payment->total_payment;
|
||||
// $updatelelbidbidder = LelongBidder::where('lelongbid_id', $sag->lelongbid_id)
|
||||
// ->first();
|
||||
// $updatelelbidbidder->status_payment = 1;
|
||||
// $updatelelbidbidder->save();
|
||||
|
||||
}
|
||||
foreach($senaraisag as $sag)
|
||||
{
|
||||
$eachbid = LelongBid::where('id',$sag->lelongbid_id)->first();
|
||||
$eachbid->status_payment = 1;
|
||||
$eachbid->status_jual = 1;
|
||||
$eachbid->t_jual = $currentdate;
|
||||
$eachbid->save();
|
||||
|
||||
}
|
||||
|
||||
$senaraisagallpayment = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
|
||||
Reference in New Issue
Block a user