feat(gvg): 征战中原排行榜奖励

This commit is contained in:
luying
2023-02-17 10:58:46 +08:00
parent fc2a86ad81
commit eb772484c2
21 changed files with 678 additions and 100 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ export default class GVGLeagueFarm extends BaseModel {
public static async lockMineOrForestry(configId: number, leagueCode: string, farmId: number, type: number, roleId: string, fieldId: number, itemId: number) {
// 先创建
await GVGLeagueFarmModel.findOneAndUpdate({ configId, leagueCode, farmId, fieldId }, { $setOnInsert: { unlockTime: 0, itemId: 0, type } }, { upsert: true });
let unlockTime = nowSeconds() + type == GVG_RESOURCE_TYPE.MINERAL? GVG.GVG_MINE_LOCK_TIME: GVG.GVG_FORESTRY_LOCK_TIME;
let unlockTime = nowSeconds() + (type == GVG_RESOURCE_TYPE.MINERAL? GVG.GVG_MINE_LOCK_TIME: GVG.GVG_FORESTRY_LOCK_TIME);
const result: GVGLeagueFarmType = await GVGLeagueFarmModel.findOneAndUpdate(
{ configId, leagueCode, farmId, fieldId, $or:[{ unlockTime: { $lt: nowSeconds() } }, {lockRoleId: roleId}] },
{ $set: { unlockTime, lockRoleId: roleId, itemId } },