This commit is contained in:
aozhiwei 2022-01-29 13:13:31 +08:00
parent 8e405a57eb
commit bb7f2822a2
2 changed files with 18 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
}