排行榜:修复一键领取
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { HANG_UP_CONSTS, ROLE_TERAPH, ROLE_SELECT, ABI_TYPE, TIME_OUTPUT_TYPE } from './../consts';
|
||||
import { HANG_UP_CONSTS, ROLE_TERAPH, ROLE_SELECT, ABI_TYPE } from './../consts';
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, Ref, mongoose } from '@typegoose/typegoose';
|
||||
import User from './User';
|
||||
@@ -641,8 +641,8 @@ export default class Role extends BaseModel {
|
||||
return roles[Math.floor(roles.length / 2)]
|
||||
}
|
||||
|
||||
public static async receiveRankReward(roleId: string, id: number) {
|
||||
const role: RoleType = await RoleModel.findOneAndUpdate({ roleId, rankReceived: { $nin: [id] } }, { $push: { rankReceived: id } }, { new: true }).lean();
|
||||
public static async receiveRankReward(roleId: string, ids: number[]) {
|
||||
const role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $push: { rankReceived: { $each: ids } } }, { new: true }).lean();
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user