liuyu %!s(int64=4) %!d(string=hai) anos
pai
achega
0470ab070e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 });
     const students = await this.stumodel.find({ classid });
     let res = false;
     let res = false;
     for (const stu of students) {
     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') {
       if (sch && sch.hascar === '0') {
         res = true;
         res = true;
         break;
         break;