🐞 fix(商店): 限制限时商店超时不可购买

This commit is contained in:
luying
2022-10-26 17:14:08 +08:00
parent e14368a6e7
commit 31e00b93f3
2 changed files with 5 additions and 1 deletions
@@ -9,6 +9,7 @@ import { HeroModel } from "../../../db/Hero";
import { checkShopInPurchase, getShopDicById, getShopListByType, getShopPrice } from "../../../services/shopService";
import { RewardInter } from "../../../pubUtils/interface";
import { UserShopTypeModel } from "../../../db/UserShopType";
import { nowSeconds } from "../../../pubUtils/timeUtil";
export default function(app: Application) {
return new ShopHandler(app);
@@ -58,6 +59,8 @@ export class ShopHandler {
let dicShopItem = await getShopDicById(activityId, shopItemId, roleId, serverId);
if(!dicShopItem) return resResult(STATUS.DIC_DATA_NOT_FOUND);
if(dicShopItem['productID'] && dicShopItem['productID'] != '&') return resResult(STATUS.CAN_NOT_PURCHASE);
if(dicShopItem['beginTime'] && dicShopItem['beginTime'] > nowSeconds()) return resResult(STATUS.SHOP_CLOSED);
if(dicShopItem['endTime'] && dicShopItem['endTime'] < nowSeconds()) return resResult(STATUS.SHOP_CLOSED);
let userShop = await UserShopModel.findByRoleAndItem(roleId, activityId, dicShopItem, seasonNum);