秘境本挑战次数

This commit is contained in:
luying
2020-11-13 18:06:53 +08:00
parent 9574bada4f
commit ada3cfe849
18 changed files with 439 additions and 82 deletions
+6
View File
@@ -71,6 +71,12 @@ export default class PvpDefense extends BaseModel {
}
public static async updateCe(roleId: string, hid: number, ce: number, oldCe: number, lean = true) {
let distance = ce - oldCe;
const rec = await PvpDefenseModel.findOneAndUpdate({roleId, 'heroes.actorId': hid}, {$inc: {ce: distance}}).lean(lean);
return rec
}
public static async deleteAccount(roleId: string, lean = true) {
let result = await PvpDefenseModel.deleteMany({roleId}).lean(lean);
return result||{};