From bb7f2822a24604f47caaedda3133261754a0a948 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 29 Jan 2022 13:13:31 +0800 Subject: [PATCH] 1 --- webapp/controller/MarketController.class.php | 2 +- webapp/mt/WhiteList.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index e611f2cd..87cd14dd 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -163,7 +163,7 @@ class MarketController extends BaseController { myself()->_rspErr(500, 'server internal error'); return; } - if (!mt\MarketGoods::isOnSaleItem($batchId, $idx, $itemId)) { + if (!mt\MarketGoods::isOnSaleItem($currBatchMeta['batch_id'], $idx, $itemId)) { myself()->_rspErr(500, 'server internal error'); return; } diff --git a/webapp/mt/WhiteList.php b/webapp/mt/WhiteList.php index 89729e70..36af8cab 100644 --- a/webapp/mt/WhiteList.php +++ b/webapp/mt/WhiteList.php @@ -14,6 +14,12 @@ class WhiteList { return getXVal(self::getMetaList(), $id); } + public static function inWhiteList($account) + { + self::mustBeAccountHash(); + return getXVal(self::$accountHash, $account, null) != null; + } + protected static function getMetaList() { if (!self::$metaList) { @@ -22,6 +28,17 @@ class WhiteList { return self::$metaList; } + protected static function mustBeAccountHash() + { + if (!self::$accountHash) { + self::$accountHash = array(); + foreach (self::getMetaList() as $meta) { + self::$accountHash[$meta['white_list']] = $meta; + } + } + } + protected static $metaList; + protected static $accountHash; }