From 58016e72fedda8d05b75d19058866f758bf1df2e Mon Sep 17 00:00:00 2001 From: Marvin Cunanan Date: Mon, 7 Dec 2020 13:37:02 +0900 Subject: [PATCH 1/3] Update code to save facility reservation --- app/controllers/servers_controller.php | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/app/controllers/servers_controller.php b/app/controllers/servers_controller.php index 9d210e302..b07269521 100644 --- a/app/controllers/servers_controller.php +++ b/app/controllers/servers_controller.php @@ -1903,6 +1903,15 @@ class ServersController extends WebServicesController 'array' => 'storeTransactionDetailInformation' ), + 'storeTransactionFacility' => array('struct' => array( + 'POSID' => 'xsd:int', + 'STARTTIME' => 'xsd:string', + 'ENDTIME' => 'xsd:string' + )), + '_storeTransactionFacility' => array( + 'array' => 'storeTransactionFacility' + ), + 'storeTransactionInformation' => array('struct' => array( 'TRANSCODE' => 'xsd:string', 'KEYNO' => 'xsd:int', @@ -2002,6 +2011,7 @@ class ServersController extends WebServicesController 'PUSH_TO_KANZASHI' => 'xsd:string', 'DESTINATION_KANZASHI_SALON_POS_ID' => 'xsd:int', 'details' => 'tns:_storeTransactionDetailInformation', + 'facilities' => 'tns:_storeTransactionFacility', 'rejimarketing' => 'tns:_rejiMarketingInformation' )), '_storeTransactionInformation' => array( @@ -8744,6 +8754,37 @@ function wsAddUpdateStoreTransaction($sessionid, $param) } } #------------------------------------------------------------------------------------------------------------------------ + # SAVE / UPDATE FACILITY TRANSACTION + #------------------------------------------------------------------------------------------------------------------------ + $sql = " + DELETE FROM store_transaction_facilities + WHERE transcode = :transcode + "; + $retQuery[$sqlctr] = $this->StoreTransaction->query($sql, array('transcode' => $param['TRANSCODE']), false); + $sqlctr++; + + if($param['facilities']) { + $sql = " + INSERT INTO store_transaction_facilities + (transcode, rowno, facility_pos_id, start_time, end_time) + VALUES(:transcode, :rowno, :facility_pos_id, :start_time, :end_time) + "; + + for($row = 0; $row < count($param['facilities']); $row++) { + + $params = array( + 'transcode' => $param['TRANSCODE'], + 'rowno' => $row, + 'facility_pos_id' => $param['facilities'][$row]['POSID'], + 'start_time' => $param['facilities'][$row]['STARTTIME'], + 'end_time' => $param['facilities'][$row]['ENDTIME'] + ); + + $retQuery[$sqlctr] = $this->StoreTransaction->query($sql, $params, false); + $sqlctr++; + } + } + #------------------------------------------------------------------------------------------------------------------------ //--------------------------------------------------------------------------- //-- エラーのためのチェック (Checks if there are errors on all cued queries) From 805ccbfe6de67f67fe8f1a0b63403a5516c034d2 Mon Sep 17 00:00:00 2001 From: Marvin Cunanan Date: Thu, 17 Dec 2020 17:02:58 +0900 Subject: [PATCH 2/3] Added SalonId in GetAvailableFacilities field result --- app/controllers/components/misc_function.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/components/misc_function.php b/app/controllers/components/misc_function.php index 9087f65b1..f6361b31b 100644 --- a/app/controllers/components/misc_function.php +++ b/app/controllers/components/misc_function.php @@ -1872,7 +1872,8 @@ function GetAvailableFacilities(&$controller, $dbname, $salonid = null, $page = SQL_CALC_FOUND_ROWS kf.pos_id AS Id, kf.name AS Name, - kf.acceptable_count AS AcceptableCount + kf.acceptable_count AS AcceptableCount, + kf.salon_pos_id As SalonId FROM kanzashi_facility kf WHERE kf.delflg IS NULL From bddf161ff8b5b098b082c019433a6e456810293d Mon Sep 17 00:00:00 2001 From: Marvin Cunanan Date: Mon, 21 Dec 2020 11:01:45 +0900 Subject: [PATCH 3/3] Make facility "ROWNO" start at index 1 --- app/controllers/servers_controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/servers_controller.php b/app/controllers/servers_controller.php index b815a064b..7eaa3bb0c 100644 --- a/app/controllers/servers_controller.php +++ b/app/controllers/servers_controller.php @@ -8772,7 +8772,7 @@ function wsAddUpdateStoreTransaction($sessionid, $param) $params = array( 'transcode' => $param['TRANSCODE'], - 'rowno' => $row, + 'rowno' => $row + 1, 'facility_pos_id' => $param['facilities'][$row]['POSID'], 'start_time' => $param['facilities'][$row]['STARTTIME'], 'end_time' => $param['facilities'][$row]['ENDTIME']