zs hace 1 mes
padre
commit
66ed665ec4
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. 9 3
      src/controller/match/matchExt.controller.ts

+ 9 - 3
src/controller/match/matchExt.controller.ts

@@ -678,12 +678,18 @@ export class MatchExtController implements BaseController {
   @Post('/lastList/:match_id', { routerName: '赛事决赛名单' })
   async lastList(@Param('match_id') match_id: string) {
     const list = await this.matchRegService.getArrangeList(match_id);
-    const newList = [];
+    const fillList = [];
     for (const i of list) {
       let newItem = cloneDeep(i);
+      const user_id = get(i, 'user_id');
+      const user = await this.userService.fetch({ id: user_id });
+      if (user) newItem.user_name = get(user, 'nick_name');
+      const match_id = get(i, 'match_id');
+      const match = await this.matchService.fetch({ id: match_id });
+      if (match) newItem.match_name = get(match, 'name');
       newItem = await this.matchRegService.dealData(newItem);
-      newList.push(newItem);
+      fillList.push(newItem);
     }
-    return newList;
+    return fillList;
   }
 }