lrf 4 miesięcy temu
rodzic
commit
46a31d7dc8

+ 8 - 2
src/controller/platform/match.controller.ts

@@ -31,10 +31,16 @@ export class MatchController implements BaseController {
     for (const i of list) {
       const nobj = cloneDeep(i)
       const form = get(i, 'form')
-      if (form !== '4') continue
+      if (form !== '4') {
+        fillList.push(nobj)
+        continue
+      }
       const match_id = get(i, 'id')
       const extData = await this.matchExtService.fetch({ match_id })
-      if (!extData) continue;
+      if (!extData) {
+        fillList.push(nobj)
+        continue
+      }
       nobj.ext_status = get(extData, 'status')
       fillList.push(nobj)
     }

+ 2 - 2
src/entity/match/matchLastList.entity.ts

@@ -2,8 +2,8 @@ import { Entity, Column } from 'typeorm';
 import { BaseModel } from '../../frame/BaseModel';
 import dayjs = require('dayjs');
 //赛事
-@Entity('matchLastList', { comment: '双创赛事' })
-export class MatchLastList extends BaseModel {
+@Entity('matchLast', { comment: '决赛名单' })
+export class MatchLast extends BaseModel {
   @Column({ type: 'integer', nullable: true, comment: '赛事id' })
   match_id: number;
   @Column({ type: 'integer', nullable: true, comment: '用户id' })

+ 10 - 0
src/service/match/matchLast.service.ts

@@ -0,0 +1,10 @@
+import { Provide } from '@midwayjs/core';
+import { InjectEntityModel } from '@midwayjs/typeorm';
+import { Repository } from 'typeorm';
+import { BaseServiceV2 } from '../../frame/BaseServiceV2';
+import { MatchLast } from '../../entity/match/matchLast.entity';
+@Provide()
+export class MatchLastService extends BaseServiceV2 {
+  @InjectEntityModel(MatchLast)
+  model: Repository<MatchLast>;
+}