fix 合成装备bug

This commit is contained in:
luying
2020-12-21 11:45:16 +08:00
parent e05577bae8
commit dc527cae2e
11 changed files with 759 additions and 713 deletions
+5
View File
@@ -144,6 +144,11 @@ export default class Hero extends BaseModel {
return hero;
}
public static async findByHidAndRoleWithEquip(hid: number, roleId: string, lean = true) {
const hero: HeroType = await HeroModel.findOne({ hid, roleId }).populate('ePlace.equip').lean(lean);
return hero;
}
public static async addEquip(roleId: string, hid: number, ePlaceId: number, equipId: string, lean = true) {
const hero: HeroType = await HeroModel.findOneAndUpdate(
{ roleId, hid, 'ePlace.id': ePlaceId },