Merge branch '392-resq-new-api-calls-for-version-check-and-display-order-screen' into 'master'

Add scheduleOptionStatus API call. #392

Closes #392

See merge request jankstudio/resq!437
This commit is contained in:
Kendrick Chan 2020-04-30 07:35:21 +00:00
commit 13d3cfd3ee

View file

@ -2696,23 +2696,17 @@ class APIController extends Controller implements LoggedController
if ($res->isError()) if ($res->isError())
return $res->getReturnResponse(); return $res->getReturnResponse();
// TODO: end of ECQ, have this return true
$schedule_choice = true; $schedule_choice = true;
// TODO: remove the time check after ECQ // TODO: remove the time check after ECQ. This will then always return true
// get current time // get current time
$current_time = time(); $current_datetime = new DateTime();
$start_advance_order_time = strtotime('17:00'); //$current_datetime = DateTime::createFromFormat('Y-m-d H:i', '2020-04-30 17:01');
$end_advance_order_time = strtotime('08:00');
//$start_advance_order_time = strtotime('08:00');
//$end_advance_order_time = strtotime('17:00');
error_log(date('Y-m-d H:i:s', $current_time)); // get the hour
error_log(date('Y-m-d H:i:s', $start_advance_order_time)); $hour = $current_datetime->format('G');
error_log(date('Y-m-d H:i:s', $end_advance_order_time));
if (($current_time > $start_advance_order_time) && if (($hour < 8) || ($hour > 16))
($current_time < $end_advance_order_time))
$schedule_choice = false; $schedule_choice = false;
$data = [ $data = [