updated api server 11/11/2022

This commit is contained in:
e.arrahn
2022-11-11 19:14:29 +08:00
parent 20bb2e3a9d
commit 1baa436a74
+17 -2
View File
@@ -558,12 +558,27 @@ class LelongController extends Controller
$lelong = Lelong::on($cawangan['mysql'])
->where('norujukan', '=', $request->norujukan)
->where('t_lelong', '<=', $current->toDateString())
//->where('t_lelong', '<=', $current->toDateString())
->first();
if($lelong)
{
return response(1);
$date_lelong = new Carbon($lelong['t_lelong']);
if($lelong['t_lelong'] >= $current->toDateString())
{
$diff = $date_lelong->diffInDays($current);
}else{
$diff = $date_lelong->diffInDays($current);
$diff = -$diff;
}
if($diff <= 0)
{
return response(1);
}else{
return response(0);
}
}else{
return response(0);
}