feat(gvgBattle): 补充进入城池返回值中的部分结构

This commit is contained in:
liangtongchuan
2023-02-11 22:57:58 +08:00
committed by luying
parent 17795e12e6
commit be8d6d576c
3 changed files with 39 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ import { index, getModelForClass, prop, DocumentType, } from '@typegoose/typegoo
import { GVG_REC_TYPE } from '../consts';
@index({ leagueCode: 1, guildCode: 1, configId: 1 })
@index({ cityId: 1, configId: 1 })
@index({ createTime: -1 })
export default class GVGRec extends BaseModel {
@@ -42,6 +43,13 @@ export default class GVGRec extends BaseModel {
const result: GVGRecType[] = await GVGRecModel.find({ leagueCode, type }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
return result;
}
// 查询城池战报
public static async findByCity(cityId: number, configId: number) {
const result: GVGRecType[] = await GVGRecModel.find({ cityId, configId }, { _id: 0, recId: 1, params: 1, createTime: 1 }).sort({ createTime: -1 }).limit(50).lean();
return result;
}
}
export const GVGRecModel = getModelForClass(GVGRec);