From f1abda621a08f8a26f506e482335b241bfd696d2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 14 Oct 2024 10:55:54 +0800 Subject: [PATCH] 1 --- webapp/services/ShopService.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/webapp/services/ShopService.php b/webapp/services/ShopService.php index f3889a6a..cbe0ac0d 100644 --- a/webapp/services/ShopService.php +++ b/webapp/services/ShopService.php @@ -20,6 +20,8 @@ use models\GunSkin; class ShopService { + private static $dailHeroHash = array(); + public static function getGoodsList($shopId) { if ($shopId == 0) { @@ -36,6 +38,10 @@ class ShopService { if ($goodsMeta['is_close']) { continue; } + if ($goodsMeta['shop_id'] == mt\Shop::DAILY_HERO_SHOP && + !self::inDailyHeroList($goodsMeta)) { + continue; + } $goodsDto = array( 'goods_id' => $goodsMeta['goods_id'], 'goods_meta' => self::goodsMetaToInfo($goodsMeta), @@ -153,6 +159,26 @@ class ShopService { ); } + private static function getDailyHeroList() + { + if (isset(self::$dailyHeroHash[myself()->_getAccountId()])) { + return self::$dailyHeroHash[myself()->_getAccountId()]; + } + $r = myself()->_getSelfRedis(); + $data = $r->get('shop.daily.shop:' . myself()->_getAccountId()); + if (empty($data)) { + + } else { + $data = json_decode($data, true); + } + return $data; + } + + private static function inDailyHeroList($goodsMeta) + { + return in_array($goodsMeta['goods_id'], self::getDailyHeroList()); + } + // public static function canBuy($itemMeta, &$errCode, &$errMsg) // { // $errCode = 0;