优化:减少初始以及合成武将时返回的数据

This commit is contained in:
luying
2022-04-07 18:36:46 +08:00
parent f20583125d
commit 3cb5c650e2
13 changed files with 63 additions and 56 deletions

View File

@@ -25,8 +25,8 @@ export default class Item extends BaseModel {
count: number; // 道具数量
public static async findbyRole(roleId: string, lean = true) {
const items: ItemType[] = await ItemModel.find({ roleId, count: {$gte: 0} }).select('id count type').lean(lean);
public static async findbyRole(roleId: string, select = '') {
const items: ItemType[] = await ItemModel.find({ roleId, count: {$gte: 0} }).select(select).lean();
return items;
}