61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\AuthMobile;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Models\Lelong;
|
|
use App\Models\LelongBid;
|
|
use App\Models\LelongBidMarhun;
|
|
use Carbon\Carbon;
|
|
|
|
class LelongMobileController extends Controller
|
|
{
|
|
public function listLelongDetails(Request $request){
|
|
|
|
$currentdate = Carbon::now();
|
|
$currentdate = $currentdate->toDateString();
|
|
|
|
$lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get();
|
|
|
|
$arrayID = [];
|
|
foreach($lelong as $data)
|
|
{
|
|
array_push($arrayID,$data->id);
|
|
}
|
|
$lelongbid = LelongBid::whereIn('lelong_id',$arrayID)
|
|
->join('lelongbidmarhun','lelongbid.id','=','lelongbidmarhun.lelongbid_id')
|
|
->get();
|
|
|
|
$surat = LelongBid::whereIn('lelong_id',$arrayID)->get();
|
|
|
|
if(sizeof($lelongbid)!=0)
|
|
{
|
|
return response()->json([
|
|
'success' => true,
|
|
'lelong' => $lelong,
|
|
'surat' => $surat,
|
|
'item' => $lelongbid
|
|
]);
|
|
}
|
|
else
|
|
{
|
|
return response()->json([
|
|
'success' => false,
|
|
'message' => 'No Data',
|
|
], 401);
|
|
}
|
|
|
|
}
|
|
|
|
public function getlelongdetails(Request $request){
|
|
|
|
$currentdate = Carbon::now();
|
|
$currentdate = $currentdate->toDateString();
|
|
|
|
$lelong = Lelong::where('tarikh_lelong','=',$currentdate)->get();
|
|
|
|
|
|
}
|
|
}
|