✨ feat(gvg): 征战中原排行榜奖励
This commit is contained in:
@@ -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 } },
|
||||
|
||||
Reference in New Issue
Block a user