fix bug 升级更新错误
This commit is contained in:
@@ -32,7 +32,7 @@ export default class Item extends BaseModel {
|
||||
}
|
||||
|
||||
public static async findByRoleAndType(roleId: string, type: number, lean = true) {
|
||||
const items = await ItemModel.find({ roleId, type }).select('id count type').lean(lean);
|
||||
const items = await ItemModel.find({ roleId, type }).select('id count type').sort({id: 1}).lean(lean);
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
@@ -382,7 +382,7 @@ export default class Role extends BaseModel {
|
||||
|
||||
public static async updateRoleInfo(roleId: string, roleUpdate:roleUpdate, lean = true) {
|
||||
delete roleUpdate._id;
|
||||
let result = await HeroModel.findOneAndUpdate({roleId}, {$set:roleUpdate}).lean(lean);
|
||||
let result = await RoleModel.findOneAndUpdate({roleId}, {$set:roleUpdate}).lean(lean);
|
||||
return result||{};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user