Skip to content

Commit

Permalink
Merge pull request smarty-php#26 from think-ahead/ticket-#5013-kirei-…
Browse files Browse the repository at this point in the history
…enable-to-set-facility-reservation

Ticket #5013 kirei enable to set facility reservation
  • Loading branch information
think-katou authored Dec 21, 2020
2 parents 83c6194 + bddf161 commit 768fb88
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/components/misc_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
JOIN sipssbeauty_kanzashi.salon s
ON s.POS_ID = kf.SALON_POS_ID
Expand Down
41 changes: 41 additions & 0 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,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',
Expand Down Expand Up @@ -2009,6 +2018,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(
Expand Down Expand Up @@ -8742,6 +8752,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 + 1,
'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)
Expand Down

0 comments on commit 768fb88

Please sign in to comment.