cdm pc & sah account
This commit is contained in:
@@ -41,7 +41,6 @@ class PaymentController extends Controller
|
||||
)
|
||||
->groupBy('lelongbidder.user_id')
|
||||
->get()->toArray();
|
||||
// dd($listwinner);
|
||||
|
||||
foreach($listwinner as $index1=>$winner){
|
||||
|
||||
@@ -52,13 +51,20 @@ class PaymentController extends Controller
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get();
|
||||
|
||||
|
||||
$payment_id = $SAGWin = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
$sts_payment = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('user_id', $winner['user_id'])
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select('lelongbidder.status_payment')
|
||||
->get();
|
||||
// dd($sts_payment[0]['status_payment']);
|
||||
|
||||
$payment_id = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('user_id', $winner['user_id'])
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select('payment_id')->groupBy('payment_id')->get();
|
||||
// dd($payment_id);
|
||||
|
||||
$total_payment = 0;
|
||||
foreach($payment_id as $id){
|
||||
$payment = Payment::where('id', $id->payment_id)
|
||||
@@ -73,6 +79,7 @@ class PaymentController extends Controller
|
||||
$listwinner[$index1]['total_surat'] = sizeof($SAGWin);
|
||||
$listwinner[$index1]['totalBid'] = $SAGWin->sum('hargabida');
|
||||
$listwinner[$index1]['totalPay'] = $total_payment;
|
||||
$listwinner[$index1]['sts_payment'] = $sts_payment[0]['status_payment'];
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +115,6 @@ class PaymentController extends Controller
|
||||
)
|
||||
->get();
|
||||
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid', 'lelong_id','user_id'));
|
||||
}
|
||||
|
||||
@@ -125,7 +131,7 @@ class PaymentController extends Controller
|
||||
$resit = Resit::where('lelong_id', $request->lelong_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->where('resit_type', 2)
|
||||
->first();
|
||||
->first();
|
||||
|
||||
$total_hargabida = 0;
|
||||
$payment = Payment::create([
|
||||
@@ -212,4 +218,47 @@ class PaymentController extends Controller
|
||||
|
||||
return view('pembayaran.pengesahanPembayaran',compact('pengesahanPembayaran'));
|
||||
}
|
||||
|
||||
public function banktransfer(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$user = Auth::user();
|
||||
// dd($user);
|
||||
|
||||
$totalcheck = implode(",", $request->checkboxdata);
|
||||
|
||||
$resit = Resit::where('lelong_id', $request->lelong_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->where('resit_type', 2)
|
||||
->first();
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->user_id = $request->user_id;
|
||||
$payment->lelong_id = $request->lelong_id;
|
||||
$payment->kodcaw = $user->kodcaw;
|
||||
$payment->status_payment_opt = 3;
|
||||
$payment->status = 2;
|
||||
$payment->remark = 'BAYARAN CDM';
|
||||
$payment->resit_id = $resit->id;
|
||||
$payment->total_payment = $totalcheck;
|
||||
$payment->diminta_pada = $currentdate;
|
||||
$payment->diminta_oleh = $user->id;
|
||||
$payment->save();
|
||||
|
||||
$sts_payment = LelongBidder::where('user_id', $request->user_id)
|
||||
->where('lelongbid_id', $request->eachbid)
|
||||
->first();
|
||||
|
||||
$sts_payment->payment_id = $payment->id;
|
||||
$sts_payment->status_payment = 2; //Menunggu pengesahan account
|
||||
$sts_payment->update();
|
||||
|
||||
return redirect()->route('pembayaran.SenaraiLelongBayar')
|
||||
->with('success','Menunggu Pengesahan Account');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user