军团表逻辑

This commit is contained in:
mamengke01
2021-01-22 21:28:35 +08:00
parent b5d84c03e4
commit 3e6ec77d56
30 changed files with 4838 additions and 1387 deletions

View File

@@ -128,6 +128,12 @@ export default class UserGuild extends BaseModel {
const result = await UserGuildModel.findOneAndUpdate({ roleId, status: USER_GUILD_STATUS.ON }, { $inc: { honourWeekly: inc } }, { new: true }).select(select).lean();
return result;
}
public static async receiveTrainRewards(roleId: string, trainId: number, lean = true) {
const result = await UserGuildModel.findOneAndUpdate({ roleId, status: USER_GUILD_STATUS.ON, 'trainRewards':{$ne: trainId }},
{$push:{trainRewards: trainId} }).lean(lean);
return result;
}
}
export const UserGuildModel = getModelForClass(UserGuild);