商店:添加名将擂台限制

This commit is contained in:
luying
2022-08-12 14:19:35 +08:00
parent 8a1ce473ed
commit 40e228ca42
4 changed files with 13 additions and 1 deletions
+7 -1
View File
@@ -12,6 +12,7 @@ import { DicShop } from "../pubUtils/dictionary/DicShop";
import { BackendSession } from "pinus";
import { ActivityModelType } from "../db/Activity";
import { addItems } from "./role/rewardService";
import { LadderMatchModel } from "../db/LadderMatch";
export async function getAllShopList(roleId: string, serverId: number) {
let userShopRecs = await UserShopModel.findByRoleId(roleId);
@@ -157,7 +158,12 @@ export async function checkShopItemCanBuy(activityId: number, shopItemId: number
return STATUS.LV_LIMIT;
}
}
if(dicShopItem.ranklimit) {
let ladder = await LadderMatchModel.findByRoleId(roleId);
if(ladder.historyRank < dicShopItem.ranklimit) {
return STATUS.LADDER_LV_LIMIT;
}
}
if(dicShopItem.purchaseLimit != -1) {
if(vipStartTime > 0 && dicShopItem.vipPurchaseLimit != -1) {
if(buyCount + count > dicShopItem.purchaseLimit + dicShopItem.vipPurchaseLimit) {