This commit is contained in:
aozhiwei 2024-10-14 10:55:54 +08:00
parent 361876efd2
commit f1abda621a

View File

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