From 38848eb8eee0b060484f4afaea75915ffcb1cdff Mon Sep 17 00:00:00 2001 From: songliang Date: Fri, 14 Jul 2023 12:18:05 +0800 Subject: [PATCH] ... --- webapp/bootstrap/constant.php | 1 + webapp/controller/MarketController.class.php | 4 ++-- webapp/controller/ShopController.class.php | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 98074b3d..3a9d6b17 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -63,6 +63,7 @@ define('TN_WEEKLY_END', 10005); define('SHOP_BUY_MODE_NORMAL', 0); define('SHOP_BUY_MODE_DAILY_SELECTION', 1); +define('MARKET_BUY_MODE_NORMAL', 2); const kHAT_Begin = 0; const kHAT_Hp = 1; diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 1a674e1c..2bccebe9 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -681,7 +681,6 @@ class MarketController extends BaseAuthedController public function buy() { - $account = strtolower(getReqVal('account', '')); $idx = getReqVal('idx', ''); $goods = $this->getGoodsByIdx($idx); @@ -712,7 +711,8 @@ class MarketController extends BaseAuthedController 'order_type' => 1, 'price' => $goods['s_price'], 'ext_data' => json_encode(array( - 'mode' => SHOP_BUY_MODE_NORMAL, + 'mode' => MARKET_BUY_MODE_NORMAL, + 'idx' => $idx, )), )); diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index e274fe31..295ae851 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -699,16 +699,16 @@ class ShopController extends BaseAuthedController { $address = $this->_getAccountId(); - $maxCount = mt\Parameter::getByName('daily_selection_refresh_time')['param_value']; + $costs = mt\Parameter::getByName('daily_selection_refresh_cost'); + $arrCosts = explode('|', $costs['param_value']); + $maxCount = count($arrCosts); + $count = $this->countTodayRefreshTimes($address); if ($count >= $maxCount) { $this->_rspErr(2, 'The maximum number of refreshes has been reached'); return; } - $count = $this->countTodayRefreshTimes($address); - $costs = mt\Parameter::getByName('daily_selection_refresh_cost'); - $arrCosts = explode('|', $costs['param_value']); $cost = $arrCosts[$count]; $costItemId = $this->getCostItemIdByTokenType(ShopController::TOKEN_TYPE_GOLD); $costItems = $this->makeCostItems($costItemId, $cost);