Selaa lähdekoodia

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-service

lrf 4 kuukautta sitten
vanhempi
commit
9126e9c9d6
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      src/controller/platform/match.controller.ts

+ 4 - 4
src/controller/platform/match.controller.ts

@@ -51,7 +51,7 @@ export class MatchController implements BaseController {
     let extData = pick(data, extColumns);
     const dbData = await this.service.create(matchData);
     // 如果类型是4,需要特殊处理下,补充赛事拓展表
-    if (get(matchData, 'type') === '4') {
+    if (get(matchData, 'form') === '4') {
       // 查查有没有拓展数据,有就不创建了
       const match_id = dbData.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);
     const extColumns = ['ext_info', 'ext_finals'];
     const matchData = omit(data, extColumns);
-    let extData = pick(data, extColumns);
+    const extData = pick(data, extColumns);
     const result = await this.service.update({ id }, matchData);
     await this.service.updateProject({ id }, data);
     // 如果类型是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;
   }