liuyu 4 years ago
parent
commit
0470ab070e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/service/lesson.js

+ 1 - 1
app/service/lesson.js

@@ -134,7 +134,7 @@ class LessonService extends CrudService {
     const students = await this.stumodel.find({ classid });
     let res = false;
     for (const stu of students) {
-      const sch = await this.schmodel.findById(stu.schid);
+      const sch = await this.schmodel.findOne({ code: stu.schid });
       if (sch && sch.hascar === '0') {
         res = true;
         break;