lrf402788946 пре 4 година
родитељ
комит
5c90f5ce4c
1 измењених фајлова са 9 додато и 0 уклоњено
  1. 9 0
      app/service/trainplan.js

+ 9 - 0
app/service/trainplan.js

@@ -124,6 +124,15 @@ class TrainplanService extends CrudService {
           }
         }
       }
+      // 查哪个学校schtime表没有生成,就给生成了
+      const schoolList = await this.smodel.find();
+      for (const school of schoolList) {
+        const r = await this.schmodel.find({ year, planid: id, schid: school.code });
+        if (r) continue;
+        const obj = { schid: school.code, year, planid: id };
+        await this.schmodel.create(obj);
+
+      }
     }
     return res;
   }