This commit is contained in:
faiqahzaman
2022-01-20 16:50:21 +08:00
parent bff3570401
commit 073cf456cf
@@ -55,6 +55,71 @@ class LelongMobileController extends Controller
$lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get();
$arrayLelong = [];
$lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get();
// $lelongbid = LelongBid::where('t_lelong', '=', $currentdate)
// ->select('lelong_id',
// 'id as lelongbid_id',
// 'caw_id',
// 'kodcaw',
// 'norujukan',
// 't_lelong as tarikh_lelong',
// 'hargaasas',
// 'hargajual',
// 't_jual',
// 'nopembeli',
// 'jbg',
// 'kadarupah',
// 'upahsimpan',
// 'ansuran',
// 'pinjaman',
// 'bakiupah',
// 'cajlain',
// 'cajlelong',
// 'baki',
// 'gst_hj',
// 'gst_cl',
// 'percent',
// 'status_jual',
// 'status_payment')
// ->get();
$lelongbid = LelongBid::whereIn('lelong_id',$arrayLelong)
->select('lelong_id',
'id as lelongbid_id',
'caw_id',
'kodcaw',
'norujukan',
't_lelong as tarikh_lelong',
'hargaasas',
'hargajual',
't_jual',
'nopembeli',
'jbg',
'kadarupah',
'upahsimpan',
'ansuran',
'pinjaman',
'bakiupah',
'cajlain',
'cajlelong',
'baki',
'gst_hj',
'gst_cl',
'percent',
'status_jual',
'status_payment')
->union($lelong)
->get();
$lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
->get();
array_push($arrayLelong,['lelong' => $lelong,'lelong_bid' => $lelongbid, 'lelong_bid_marhun' => $lelongbidmarhun]);
return response()->json($arrayLelong);
}
}