lrf 2 년 전
부모
커밋
105cba15db
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/service/statistics.js

+ 2 - 2
app/service/statistics.js

@@ -15,12 +15,12 @@ class StatisticsService extends CrudService {
     const resList = [];
     for (const team of teamList) {
       const { team_id } = team;
-      const matchList = await this.ctx.model.Schedule.find({ match_id, $or: [{ red_id: team_id }, { blue_id: team_id }] });
+      const matchList = await this.ctx.model.Schedule.find({ match_id, $or: [{ red_id: team_id }, { blue_id: team_id }], is_bye: false });
       const res = this.computedTeam(matchList, team_id);
       const info = this.getOtherInfoFromList(matchList, team_id);
       resList.push({ ...res, ...info });
     }
-    return resList;
+    return _.orderBy(resList, [ 'win', 'score' ], [ 'desc', 'desc' ]);
   }
 
   async ranking() {