秘境本挑战次数

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
+7
View File
@@ -110,6 +110,13 @@ export default class Hero extends BaseModel {
return heroes;
}
public static async updateCe(roleId: string, hid: number, ce: number, oldCe: number, historyCe: number, lean = true) {
let distance = ce - oldCe;
let historyDistance = ce > historyCe ?ce - historyCe: 0;
let result = await HeroModel.findOneAndUpdate({roleId, hid}, {$inc:{ce: distance, historyCe: historyDistance}}).lean(lean);
return result||{};
}
public static async deleteAccount(roleId: string, lean = true) {
let result = await HeroModel.deleteMany({roleId}).lean(lean);
return result||{};