lrf преди 4 месеца
родител
ревизия
106d31bce9
променени са 1 файла, в които са добавени 13 реда и са изтрити 3 реда
  1. 13 3
      src/controller/platform/match.controller.ts

+ 13 - 3
src/controller/platform/match.controller.ts

@@ -3,7 +3,7 @@ import { CVO_match, FVO_match, QVO_match, UVAO_match } from '../../interface/pla
 import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
 import { Validate } from '@midwayjs/validate';
 import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayjs/core';
-import { get, omit, pick } from 'lodash';
+import { cloneDeep, get, omit, pick } from 'lodash';
 import { ServiceError, ErrorCode } from '../../error/service.error';
 import { BaseController } from '../../frame/BaseController';
 import { ServiceUtilService } from '../../service/serviceUtil.service';
@@ -26,8 +26,18 @@ export class MatchController implements BaseController {
     const qobj = omit(query, ['skip', 'limit']);
     const others: any = pick(query, ['skip', 'limit']);
     others.order = { order_num: 'ASC' };
-    const result = await this.service.query(qobj, others);
-    return result;
+    const { data: list, total } = await this.service.query(qobj, others);
+    const fillList = [];
+    for (const i of list) {
+      const nobj = cloneDeep(i)
+      const form = get(i, 'form')
+      if (form !== '4') continue
+      const match_id = get(i, 'id')
+      const extData = await this.matchExtService.fetch({ match_id })
+      if (!extData) continue;
+      nobj.ext_status = get(extData, 'status')
+    }
+    return { data: fillList, total };
   }
 
   @Get('/:id')