liuyu 4 년 전
부모
커밋
8f40e3a2a2
2개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 4
      app/controller/group.js
  2. 3 2
      app/service/group.js

+ 1 - 4
app/controller/group.js

@@ -32,10 +32,7 @@ class GroupController extends Controller {
     this.ctx.ok({ msg: 'ok', data: res });
   }
 
-  async index() {
-    const data = await this.service.query(this.ctx.query);
-    this.ctx.ok({ ...data });
-  }
+
 }
 
 module.exports = CrudController(GroupController, meta);

+ 3 - 2
app/service/group.js

@@ -98,8 +98,9 @@ class GroupService extends CrudService {
         }
         stus.push({ ...JSON.parse(JSON.stringify(stu)), job });
       }
-      _group.students = stus;
-      data.push(_group);
+      const newdata = { ...JSON.parse(JSON.stringify(_group)) };
+      newdata.students = stus;
+      data.push(newdata);
     }
     return { total, data };
   }