|
@@ -14,6 +14,24 @@ export class CourseService extends BaseService<modelType> {
|
|
|
@InjectEntityModel(Application)
|
|
|
AppModel: ReturnModelType<typeof Application>;
|
|
|
|
|
|
+ async specialQuery(filter) {
|
|
|
+ const { skip = 0, limit = 0, ...info } = filter;
|
|
|
+ let obj = {};
|
|
|
+ if (info.team_id) {
|
|
|
+ obj = {
|
|
|
+ ...info,
|
|
|
+ $or: [
|
|
|
+ { red_team_id: { $eq: info.team_id } },
|
|
|
+ { blue_team_id: { $eq: info.team_id } },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ }
|
|
|
+ delete info.team_id;
|
|
|
+ const data: any = await this.model.find(obj).skip(skip).limit(limit);
|
|
|
+ const total = await this.model.count(info);
|
|
|
+ return { data, total };
|
|
|
+ }
|
|
|
+
|
|
|
// 排名
|
|
|
async rankQuery(filter) {
|
|
|
const { match_id } = filter;
|