🐞 fix(gvg): 遗迹挑战次数添加元宝购买逻辑
This commit is contained in:
@@ -39,8 +39,11 @@ export default class GVGUserDailyData extends BaseModel {
|
||||
@prop({ required: true, default: 0 })
|
||||
hasLogin: boolean; // 是否登录
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
costGoldCnt: number; // 已使用元宝的次数
|
||||
|
||||
public static async findByRole(configId: number, leagueCode: string, roleId: string) {
|
||||
const result: GVGUserDailyDataType = await GVGUserDailyDataModel.findOne({ configId, leagueCode, roleId, time: getZeroPoint() }).select('food mineral wood score').lean();
|
||||
const result: GVGUserDailyDataType = await GVGUserDailyDataModel.findOne({ configId, leagueCode, roleId, time: getZeroPoint() }).select('food mineral wood score costGoldCnt').lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -66,6 +69,16 @@ export default class GVGUserDailyData extends BaseModel {
|
||||
const result: GVGUserDailyDataType = await GVGUserDailyDataModel.findOneAndUpdate({ configId, leagueCode, roleId, time: getZeroPoint()}, { $inc: { food, mineral, wood }}, { new: true, upsert: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async incCostGoldCnt(configId: number, leagueCode: string, roleId: string, costGold: boolean) {
|
||||
if(costGold) {
|
||||
const result: GVGUserDailyDataType = await GVGUserDailyDataModel.findOneAndUpdate({ configId, leagueCode, roleId, time: getZeroPoint() }, { $inc: { costGoldCnt: 1 } }, { new: true, upsert: true }).lean();
|
||||
return result;
|
||||
} else {
|
||||
const result: GVGUserDailyDataType = await GVGUserDailyDataModel.findOne({ configId, leagueCode, roleId, time: getZeroPoint() }).lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const GVGUserDailyDataModel = getModelForClass(GVGUserDailyData);
|
||||
|
||||
@@ -429,6 +429,8 @@ export const GVG = {
|
||||
GVG_REVIVE_GOLD: '1&100|2&100|3&100|4&100|5&100|6&100|7&100|8&100|9&100|10&100|11&200', // GVG激战期元宝购买复活的消耗,次数&元宝数
|
||||
GVG_VESTIGE_CHALLENGE_TIME: '5:00:00&22:00:00', // 征战中原遗迹可挑战时间
|
||||
GVG_DEFAULT_BATTLE_CD: 20, // 激战期战斗锁定时长,用于玩家退出时获取不到数据的情况
|
||||
GVG_VESTIGE_BUY_COST: "31002&200", // 每次购买消耗
|
||||
GVG_VESTIGE_BUY_LIMIT: 10, // 每日上限
|
||||
};
|
||||
export const PLATFORM_CONFIG = {
|
||||
OPEN_ANIMATION: 1, // 0关,1开(开场动画视频)
|
||||
|
||||
Reference in New Issue
Block a user