试炼
This commit is contained in:
@@ -128,12 +128,13 @@ 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);
|
||||
{$push:{trainRewards: trainId} },{new: true}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const UserGuildModel = getModelForClass(UserGuild);
|
||||
|
||||
Reference in New Issue
Block a user