From 01a18c01b2c45cc469b5375e6af4eda51ffe4e84 Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 3 Jul 2023 22:29:43 +0800 Subject: [PATCH 1/5] ... --- webapp/controller/MarketController.class.php | 4 ++-- webapp/controller/ShopController.class.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 9538e901..5b1956e3 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -590,7 +590,7 @@ class MarketController extends BaseController if (empty($nftDb)) { $nftDb = Nft::getNft($row['token_id']); } - $row['info'] = Nft::toDto($nftDb); + // $row['info'] = Nft::toDto($nftDb); // $row['detail'] = Hero::toDtoInfo(Hero::findByTokenId2($row['token_id'])); // if (in_array($row['info']['info']['job'], $job) == false) continue; // if ($row['detail']['hero_lv'] < $lv) continue; @@ -1488,7 +1488,7 @@ class MarketController extends BaseController private function listMySelledNfts($account, $type) { - error_log('listMySelledNfts ' . $account . ' ' . $type); + // error_log('listMySelledNfts ' . $account . ' ' . $type); $conn = myself()->_getMarketMysql(''); diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 12c501fe..2b9f5f89 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -511,6 +511,7 @@ class ShopController extends BaseAuthedController } break; case ShopController::TOTAL_BUY_LIMIT: { + error_log("total buy limit " . $address . " " . $id . " " . $row['limit_num']); $buyRecord = getXVal($buyRecordHash, $id); $boughtTimes = $buyRecord ? $buyRecord['total_buy_times'] + 1 : 1; if ($buyRecord && getXVal($buyRecord, 'total_buy_times', 0) >= $row['limit_num']) { From d52eaf61e4bf411c806a8f1b203964113337669b Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 3 Jul 2023 22:31:14 +0800 Subject: [PATCH 2/5] ... --- webapp/controller/ShopController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 2b9f5f89..d792c2af 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -515,16 +515,16 @@ class ShopController extends BaseAuthedController $buyRecord = getXVal($buyRecordHash, $id); $boughtTimes = $buyRecord ? $buyRecord['total_buy_times'] + 1 : 1; if ($buyRecord && getXVal($buyRecord, 'total_buy_times', 0) >= $row['limit_num']) { - $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached'); + $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached 1'); return; } if ($row['limit_num'] <= 0) { - $this->_rspErr(2, 'he maximum number of purchase restrictions has been reached'); + $this->_rspErr(2, 'he maximum number of purchase restrictions has been reached 2'); return; } $sendingTimes = $this->countBuyGoodsRequestTimesByGoodsId($address, $row['goods_id']); if ($sendingTimes >= $row['limit_num']) { - $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached'); + $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached 3'); return; } } From 1a50c0af8a110ac1b1536a56c02e5fcbcb85b15b Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 4 Jul 2023 10:35:50 +0800 Subject: [PATCH 3/5] ... --- webapp/controller/BaseAuthedController.class.php | 2 ++ webapp/controller/ShopController.class.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 0a6da045..8ccd92f0 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -75,11 +75,13 @@ class BaseAuthedController extends BaseController { $this->accountId = getReqVal('account_id', ''); $this->sessionId = getReqVal('session_id', ''); + if (SERVER_ENV != _DEBUG) { if (!phpcommon\isValidSessionId($this->accountId, $this->sessionId)) { phpcommon\sendError(500, 'invalid session_id'); die(); } + } if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) { if ((getReqVal('c', '') == 'Battle')) { return; diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index d792c2af..271f22a6 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -522,11 +522,11 @@ class ShopController extends BaseAuthedController $this->_rspErr(2, 'he maximum number of purchase restrictions has been reached 2'); return; } - $sendingTimes = $this->countBuyGoodsRequestTimesByGoodsId($address, $row['goods_id']); - if ($sendingTimes >= $row['limit_num']) { - $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached 3'); - return; - } + // $sendingTimes = $this->countBuyGoodsRequestTimesByGoodsId($address, $row['goods_id']); + // if ($sendingTimes >= $row['limit_num']) { + // $this->_rspErr(2, 'The maximum number of purchase restrictions has been reached 3'); + // return; + // } } break; default: { From 66150f704760eca7b3bf09ac259d5aab7929f397 Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 4 Jul 2023 10:53:54 +0800 Subject: [PATCH 4/5] ... --- doc/Shop.py | 1 + webapp/controller/ShopController.class.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/Shop.py b/doc/Shop.py index 224040c6..60c5250f 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -60,6 +60,7 @@ class Shop(object): 'url': 'webapp/index.php?c=Shop&a=getGoodsList', 'params': [ _common.ReqHead(), + ['shop_id', 0, '商店id 0: 所有商店(较慢)'], ], 'response': [ _common.RspHead(), diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 271f22a6..a25344c5 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -113,7 +113,13 @@ class ShopController extends BaseAuthedController public function getGoodsList() { - $goodsList = mt\ShopGoods::all(); + $shop_id = getReqVal('shop_id', 0); + if ($shop_id == 0) { + $goodsList = mt\ShopGoods::all(); + } else { + $goodsList = mt\ShopGoods::getGoodsList($shop_id); + } + $goodsList = $goodsList ? $goodsList : array(); $buyRecordHash = ShopBuyRecord::allToHash(); @@ -757,7 +763,7 @@ class ShopController extends BaseAuthedController ) ); } - + public function openBlindBox() { $account = $this->_getAccountId(); From 04626d074daf56c273be5ccab1e9c1ddc027954b Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 4 Jul 2023 11:03:34 +0800 Subject: [PATCH 5/5] ... --- doc/Shop.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Shop.py b/doc/Shop.py index 60c5250f..427dc86d 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -9,7 +9,7 @@ class Shop(object): self.apis = [ { 'name': 'info', - 'desc': '获取商店信息', + 'desc': '获取商店信息[废弃]', 'group': 'Shop', 'url': 'webapp/index.php?c=Shop&a=info', 'params': [ @@ -23,7 +23,7 @@ class Shop(object): }, { 'name': 'buyGoods', - 'desc': '购买商品', + 'desc': '购买商品[废弃]', 'group': 'Shop', 'url': 'webapp/index.php?c=Shop&a=buyGoods', 'params': [ @@ -42,7 +42,7 @@ class Shop(object): }, { 'name': 'getDiscountList', - 'desc': '获取商品折扣列表', + 'desc': '获取商品折扣列表[废弃]', 'group': 'Shop', 'url': 'webapp/index.php?c=Shop&a=getDiscountList', 'params': [ @@ -82,7 +82,7 @@ class Shop(object): }, { 'name': 'buyGoodsNew', - 'desc': '购买商品(新)', + 'desc': '购买商品[废弃]', 'group': 'Shop', 'url': 'webapp/index.php?c=Shop&a=buyGoodsNew', 'params': [