优化:减少初始以及合成武将时返回的数据
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user