1
This commit is contained in:
parent
361876efd2
commit
f1abda621a
@ -20,6 +20,8 @@ use models\GunSkin;
|
|||||||
|
|
||||||
class ShopService {
|
class ShopService {
|
||||||
|
|
||||||
|
private static $dailHeroHash = array();
|
||||||
|
|
||||||
public static function getGoodsList($shopId)
|
public static function getGoodsList($shopId)
|
||||||
{
|
{
|
||||||
if ($shopId == 0) {
|
if ($shopId == 0) {
|
||||||
@ -36,6 +38,10 @@ class ShopService {
|
|||||||
if ($goodsMeta['is_close']) {
|
if ($goodsMeta['is_close']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($goodsMeta['shop_id'] == mt\Shop::DAILY_HERO_SHOP &&
|
||||||
|
!self::inDailyHeroList($goodsMeta)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$goodsDto = array(
|
$goodsDto = array(
|
||||||
'goods_id' => $goodsMeta['goods_id'],
|
'goods_id' => $goodsMeta['goods_id'],
|
||||||
'goods_meta' => self::goodsMetaToInfo($goodsMeta),
|
'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)
|
// public static function canBuy($itemMeta, &$errCode, &$errMsg)
|
||||||
// {
|
// {
|
||||||
// $errCode = 0;
|
// $errCode = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user