|
@@ -3,7 +3,7 @@ import { CVO_match, FVO_match, QVO_match, UVAO_match } from '../../interface/pla
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
import { Validate } from '@midwayjs/validate';
|
|
import { Validate } from '@midwayjs/validate';
|
|
import { Controller, Inject, Get, Param, Post, Body, Del, Query } from '@midwayjs/core';
|
|
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 { ServiceError, ErrorCode } from '../../error/service.error';
|
|
import { BaseController } from '../../frame/BaseController';
|
|
import { BaseController } from '../../frame/BaseController';
|
|
import { ServiceUtilService } from '../../service/serviceUtil.service';
|
|
import { ServiceUtilService } from '../../service/serviceUtil.service';
|
|
@@ -26,8 +26,18 @@ export class MatchController implements BaseController {
|
|
const qobj = omit(query, ['skip', 'limit']);
|
|
const qobj = omit(query, ['skip', 'limit']);
|
|
const others: any = pick(query, ['skip', 'limit']);
|
|
const others: any = pick(query, ['skip', 'limit']);
|
|
others.order = { order_num: 'ASC' };
|
|
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')
|
|
@Get('/:id')
|