update button kemaskini caj rugi lelong
This commit is contained in:
@@ -7227,27 +7227,7 @@ class LelongController extends Controller
|
||||
}
|
||||
|
||||
//check button kemaskini
|
||||
|
||||
$lelong = Lelong::with(['cawangan', 'lelongBidJual'])->find($lelongid);
|
||||
$allCawangan = $lelong->cawangan->keyBy('caw_code');
|
||||
$lelongBid = $lelong->lelongBidJual->where('caw_id', '=', $cawid)->groupBy('kodcaw');
|
||||
// dd( $lelongBid);
|
||||
|
||||
foreach ($lelongBid as $index => $lelong_bid) {
|
||||
foreach ($allCawangan as $data => $cawangan) {
|
||||
if ($data == $index) {
|
||||
$cawangan['lelongBid'] = $lelong_bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($lelong->cawangan as $index => $caw) {
|
||||
$allLelongBid = $caw->lelongBid->where('caw_id', '=', $cawid)->count();
|
||||
$settlePayment = $caw->lelongBid->where('status_payment', 1)->where('caw_id', '=', $cawid)->count();
|
||||
|
||||
$lelong->cawangan[$index]['lelong_laku'] = $allLelongBid;
|
||||
$lelong->cawangan[$index]['selesai_bayar'] = $settlePayment;
|
||||
}
|
||||
$lelong = CawanganLelong::where('caw_id', '=', $cawid)->where('lelong_id', '=', $lelongid)->first();
|
||||
return view('lelong.senaraiubahrugilelongnew',compact('lelong','arraymarhun','marhuns','lelongid','cawid','arrayinfo','total_berat',
|
||||
'total_pinjaman',
|
||||
'total_upah',
|
||||
|
||||
Reference in New Issue
Block a user