Skip to content

Commit

Permalink
Merge pull request smarty-php#24 from think-ahead/ticket-#5140-make-w…
Browse files Browse the repository at this point in the history
…eb-reservation-work-even-for-kirei-or-multi-kanzashi-account

Ticket #5140 make web reservation work even for kirei or multi kanzashi account
  • Loading branch information
think-katou authored Nov 27, 2020
2 parents 3730cd2 + d293c6a commit 1b9932a
Showing 1 changed file with 11 additions and 18 deletions.
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

0 comments on commit 1b9932a

Please sign in to comment.