Skip to content

Commit

Permalink
Merge pull request smarty-php#25 from think-ahead/release-2.0.3
Browse files Browse the repository at this point in the history
Merge release-2.0.3 into master branch
  • Loading branch information
think-seron authored Dec 8, 2020
2 parents 12332e5 + 1b9932a commit e8a1c68
Show file tree
Hide file tree
Showing 91 changed files with 314 additions and 3,966 deletions.
36 changes: 35 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
*.sln
*.user
*.phpproj
.vs
.vs

/app/tmp/*
!/app/tmp/cache/
!/app/tmp/logs/
!/app/tmp/sessions/
!/app/tmp/smarty/
!/app/tmp/tests/

/app/tmp/cache/*
!/app/tmp/cache/views/
/app/tmp/cache/views/*
!/app/tmp/cache/views/.gitkeep

!/app/tmp/cache/persistent/
/app/tmp/cache/persistent/*
!/app/tmp/cache/persistent/.gitkeep

/app/tmp/logs/*
!/app/tmp/logs/.gitkeep

/app/tmp/sessions/*
!/app/tmp/sessions/.gitkeep

/app/tmp/smarty/*
!/app/tmp/smarty/cache/
/app/tmp/smarty/cache/*
!/app/tmp/smarty/cache/.gitkeep

!/app/tmp/smarty/compile/
/app/tmp/smarty/compile/*
!/app/tmp/smarty/compile/.gitkeep

/app/tmp/tests/*
!/app/tmp/tests/.gitkeep
29 changes: 11 additions & 18 deletions app/controllers/components/keitai_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,17 +551,9 @@ function GetStoreInfo(&$controller, $companyid, $storecode, $dbname = "") {
$arrReturn['logintype'] = $logintype;
$arrReturn['storeid'] = $account_data[0]['WebyanAccount']['storeid'];
$arrReturn['tosflg'] = $account_data[0]['WebyanAccount']['tos_flg'];
$result = $this->GetKanzashiSalons($controller, $companyid, $storecode);
$arrReturn['KanzashiFlag'] = count($result) > 0;

// The below if block was added so that the program can return an error
// because our current program doesn't support KIREI salons or multiple accounts.
// Please note that this fix is temporary
// and should be removed after receiving support for KIREI salon and multiple accounts.
if ($result[0]['salon']['kanzashi_type'] == "KIREI" or count($result) > 1) {
return false;
}

$kanzashiSalons = $this->GetKanzashiSalons($controller, $companyid, $storecode);
$arrReturn['KanzashiFlag'] = count($kanzashiSalons) > 0;

$controller->StoreSettings->set_company_database($dbname, $controller->StoreSettings);
$criteria = array('STORECODE' => $storecode);
$v = $controller->StoreSettings->find('all', array('conditions' => $criteria));
Expand Down Expand Up @@ -2921,13 +2913,14 @@ function SetAccesslog(&$controller, $dbName,$sessionid,$ccode,$storecode,$window
function GetKanzashiSalons(&$controller, $company, $storecode)
{
$sql = "
SELECT
kanzashi_type,
kanzashi_id
FROM sipssbeauty_kanzashi.salon
WHERE
companyid = ? AND
storecode = ?
SELECT
kanzashi_type,
kanzashi_id
FROM sipssbeauty_kanzashi.salon
WHERE
status IN (5, 6, 7, 8, 9, 10, 11, 101, 102) AND
companyid = ? AND
storecode = ?
";
$param = array($company, $storecode);
return $controller->Store->query($sql, $param, false);
Expand Down
31 changes: 19 additions & 12 deletions app/controllers/components/misc_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ function second_transaction_sort($prev, $next)
#------------------------------------------------------------------------------------------------------------------------
$arrList[$ctr]['secondnote'] = $arrData[$i]['str_bm_notes']['secondnote'];
$arrList[$ctr]['MAINSTAFFCODE'] = $arrData[$i]['transaction']['MAINSTAFFCODE'];
$arrList[$ctr]['PUSH_TO_KANZASHI'] = $arrData[$i]['transaction']['PUSH_TO_KANZASHI'];
$arrList[$ctr]['DESTINATION_KANZASHI_SALON_POS_ID'] = $arrData[$i]['transaction']['DESTINATION_KANZASHI_SALON_POS_ID'];

if ($arrData[$i]['transaction']['origination'] !== '12') {
// かんざし連携以外の場合
Expand Down Expand Up @@ -1899,18 +1901,23 @@ function GetAvailableFacilities(&$controller, $dbname, $salonid = null, $page =
public function GetKanzashiSalons(&$controller, $companyid, $storecode)
{
$sql = "
SELECT
pos_id As SalonId,
kanzashi_id As KanzashiId,
pos_name as Name,
kanzashi_type As KanzashiType,
status As Status,
sync_kanzashi_enabled_staff_reservation_only As SyncKanzashiEnabledStaffReservationOnly,
free_staffcode As FreeStaffcode
FROM sipssbeauty_kanzashi.salon
WHERE
companyid = :companyid AND
storecode = :storecode
SELECT
salon.*
FROM (SELECT pos_id AS SalonId,
sl.kanzashi_id AS KanzashiId,
sl.pos_name AS Name,
sl.kanzashi_type AS KanzashiType,
sl.status AS Status,
CONVERT(st.sync_kanzashi_enabled_staff_reservation_only, UNSIGNED) AS SyncKanzashiEnabledStaffReservationOnly,
sl.free_staffcode AS FreeStaffcode,
sl.is_main_salon AS IsMainSalon
FROM sipssbeauty_kanzashi.salon AS sl
JOIN sipssbeauty_kanzashi.store AS st
USING(companyid, storecode)
WHERE
sl.companyid = :companyid AND
sl.storecode = :storecode
)AS salon
";

$param = compact('companyid', 'storecode');
Expand Down
Loading

0 comments on commit e8a1c68

Please sign in to comment.