|
@@ -51,7 +51,7 @@ export class MatchController implements BaseController {
|
|
let extData = pick(data, extColumns);
|
|
let extData = pick(data, extColumns);
|
|
const dbData = await this.service.create(matchData);
|
|
const dbData = await this.service.create(matchData);
|
|
// 如果类型是4,需要特殊处理下,补充赛事拓展表
|
|
// 如果类型是4,需要特殊处理下,补充赛事拓展表
|
|
- if (get(matchData, 'type') === '4') {
|
|
|
|
|
|
+ if (get(matchData, 'form') === '4') {
|
|
// 查查有没有拓展数据,有就不创建了
|
|
// 查查有没有拓展数据,有就不创建了
|
|
const match_id = dbData.id;
|
|
const match_id = dbData.id;
|
|
const ed = await this.matchExtService.fetch({ match_id });
|
|
const ed = await this.matchExtService.fetch({ match_id });
|
|
@@ -72,12 +72,12 @@ export class MatchController implements BaseController {
|
|
if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
|
|
if (!id) throw new ServiceError(ErrorCode.ID_NOT_FOUND);
|
|
const extColumns = ['ext_info', 'ext_finals'];
|
|
const extColumns = ['ext_info', 'ext_finals'];
|
|
const matchData = omit(data, extColumns);
|
|
const matchData = omit(data, extColumns);
|
|
- let extData = pick(data, extColumns);
|
|
|
|
|
|
+ const extData = pick(data, extColumns);
|
|
const result = await this.service.update({ id }, matchData);
|
|
const result = await this.service.update({ id }, matchData);
|
|
await this.service.updateProject({ id }, data);
|
|
await this.service.updateProject({ id }, data);
|
|
// 如果类型是4,需要特殊处理下,补充赛事拓展表,不需要修改状态和赛事id
|
|
// 如果类型是4,需要特殊处理下,补充赛事拓展表,不需要修改状态和赛事id
|
|
- if (get(matchData, 'type') === '4') {
|
|
|
|
- await this.matchExtService.update({ match_id: id }, extData);
|
|
|
|
|
|
+ if (get(matchData, 'form') === '4') {
|
|
|
|
+ await this.matchExtService.update({ match_id: id }, { info: get(extData, 'ext_info'), finals: get(extData, 'ext_finals') });
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|