寻宝:藏宝图查询
This commit is contained in:
@@ -26,6 +26,16 @@ export default class Item extends BaseModel {
|
||||
return items;
|
||||
}
|
||||
|
||||
public static async findbyRoleAndIds(roleId: string, ids: Array<number>, lean = true) {
|
||||
const items = await ItemModel.find({ roleId, id: {$in: ids} }).select('id count type').lean(lean);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static async findByRoleAndType(roleId: string, type: number, lean = true) {
|
||||
const items = await ItemModel.find({ roleId, type }).select('id count type').lean(lean);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static async findbyRoleAndGidAndCount(roleId: string, id: number, count: number, lean = true) {
|
||||
const items = await ItemModel.findOne({ roleId, id, count: {$gte: count} }).select('id count type').lean(lean);
|
||||
return items;
|
||||
|
||||
Reference in New Issue
Block a user