🐞 fix(gvg): 帮收玩家名记录错误

This commit is contained in:
luying
2023-03-03 11:24:33 +08:00
parent 7d3cb441d0
commit c970d33fdd
2 changed files with 3 additions and 3 deletions

View File

@@ -108,9 +108,9 @@ export default class GVGLeagueFarm extends BaseModel {
}));
const result = await GVGLeagueFarmModel.bulkWrite(lands.map(({ fieldId, addType }) => {
if(addType > 0) {
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, $or:[{ unlockTime: { $lt: nowSeconds() }}, {lockRoleId: roleId, lockRoleName: roleName} ] }, update: { $set: { addType, unlockTime: nowSeconds() + GVG.GVG_FARM_LOCK_TIME, lockRoleId: roleId }, $push: { addTypes: { addType, roleId } } } } }
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, $or:[{ unlockTime: { $lt: nowSeconds() }}, {lockRoleId: roleId } ] }, update: { $set: { addType, unlockTime: nowSeconds() + GVG.GVG_FARM_LOCK_TIME, lockRoleId: roleId, lockRoleName: roleName }, $push: { addTypes: { addType, roleId } } } } }
} else {
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, $or:[{ unlockTime: { $lt: nowSeconds() }}, {lockRoleId: roleId, lockRoleName: roleName} ] }, update: { $set: { addType, unlockTime: nowSeconds() + GVG.GVG_FARM_LOCK_TIME, lockRoleId: roleId } } } }
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, $or:[{ unlockTime: { $lt: nowSeconds() }}, {lockRoleId: roleId } ] }, update: { $set: { addType, unlockTime: nowSeconds() + GVG.GVG_FARM_LOCK_TIME, lockRoleId: roleId, lockRoleName: roleName } } } }
}
}));
return result;