🐞 fix(商店): 限制限时商店超时不可购买
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user