Merge branch 'faiqahzaman' into azfar_dev
This commit is contained in:
@@ -62,10 +62,6 @@ class LelongMobileController extends Controller
|
||||
|
||||
public function bidderSelectBidItem(Request $request){
|
||||
|
||||
// $feepayment = Payment::select('status')
|
||||
// ->where('status', 1)
|
||||
// ->first();
|
||||
|
||||
$feepayment = Payment::where('status', '=', 1)->first();
|
||||
|
||||
if($feepayment != null){
|
||||
@@ -103,4 +99,54 @@ class LelongMobileController extends Controller
|
||||
return response()->json("unsuccess", 201);
|
||||
}
|
||||
}
|
||||
|
||||
public function listBidItem(Request $request){
|
||||
|
||||
$lelongbidder = LelongBidder::where('user_id','=', $request->user_id)
|
||||
->get()->toArray();
|
||||
|
||||
foreach($lelongbidder as $index1=>$lelbid)
|
||||
{
|
||||
$lelongbid = LelongBid::whereIn('id',$lelongbidder)
|
||||
->get()->toArray();
|
||||
|
||||
$lelongbidder[$index1]['lelongbid'] = $lelongbid;
|
||||
}
|
||||
|
||||
return response()->json($lelongbidder);
|
||||
}
|
||||
|
||||
public function searchLelByCaw(Request $request){
|
||||
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateString();
|
||||
|
||||
// $arrayLelong = [];
|
||||
$lelong = Lelong::join('cawangan_lelong', 'lelong.id', '=', 'cawangan_lelong.lelong_id')
|
||||
->where('tarikh_lelong','=',$currentdate)
|
||||
->where('caw_id', '=', $request->caw_id)
|
||||
->get()->toArray();
|
||||
|
||||
foreach($lelong as $index1=>$lel)
|
||||
{
|
||||
$lelongbid = LelongBid::where('lelong_id',$lel['lelong_id'])
|
||||
->get()->toArray();
|
||||
|
||||
$lelong[$index1]['lelongbid'] = $lelongbid;
|
||||
|
||||
foreach($lelongbid as $index2=>$lelbidmarhun){
|
||||
$cawangan = Cawangan::where('id','=',$lelbidmarhun['caw_id'])->first()->toArray();
|
||||
// $id = lelongbid::first();
|
||||
|
||||
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id'])
|
||||
->get()->toArray();
|
||||
|
||||
$lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun;
|
||||
$lelong[$index1]['lelongbid'][$index2]['cawangan'] = $cawangan;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return response()->json($lelong);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user