🐞 fix(gvg): 农场收获之后有残留
This commit is contained in:
@@ -135,7 +135,7 @@ export default class GVGLeagueFarm extends BaseModel {
|
||||
public static async harvest(configId: number, leagueCode: string, farmId: number, fieldIds: number[], roleId: string) {
|
||||
const batchCode = genCode(10);
|
||||
const result = await GVGLeagueFarmModel.bulkWrite(fieldIds.map(fieldId => {
|
||||
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, lockRoleId: roleId, harvestTime: { $lt: nowSeconds() } }, update: { $set: { unlockTime: 0, harvestTime: 0, lockRoleId: '', lockRoleName: '', batchCode }} } }
|
||||
return { updateOne: { filter: { configId, leagueCode, farmId, fieldId, lockRoleId: roleId, harvestTime: { $lt: nowSeconds() } }, update: { $set: { unlockTime: 0, harvestTime: 0, seedType: 0, lockRoleId: '', lockRoleName: '', batchCode }} } }
|
||||
}));
|
||||
if(result.modifiedCount == 0) return [];
|
||||
const fieldResult: GVGLeagueFarmType[] = await GVGLeagueFarmModel.find({ batchCode }).sort({ fieldId: 1 }).select('-_id -createdAt -updatedAt -__v -configId -leagueCode').lean();
|
||||
|
||||
Reference in New Issue
Block a user