liuyu 5 年之前
父節點
當前提交
0470ab070e
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;