reloaded 4 years ago
parent
commit
3209f6e604
2 changed files with 3 additions and 1 deletions
  1. 2 0
      app/service/class.js
  2. 1 1
      app/service/lesson.js

+ 2 - 0
app/service/class.js

@@ -153,6 +153,8 @@ class ClassService extends CrudService {
 
   async fetch({ id }) {
     const classInfo = _.cloneDeep(JSON.parse(JSON.stringify(await this.model.findById(id))));
+    console.log(classInfo);
+
     const trainplan = await this.tmodel.findById(classInfo.planid);
     if (trainplan) {
       const term = _.filter(trainplan.termnum, item => item.id === classInfo.termid);

+ 1 - 1
app/service/lesson.js

@@ -213,7 +213,7 @@ class LessonService extends CrudService {
       });
       for (const elm of lessons) {
         if (elm.classid) {
-          const cla = await this.ctx.service.class.fetch(elm.classid);
+          const cla = await this.ctx.service.class.fetch({ id: elm.classid });
           data.push(cla);
         }
       }