Browse Source

创建学校计划时,使用的年不对

lrf 1 year ago
parent
commit
6fcdfbcbce
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/trainplan.js

+ 2 - 2
app/service/trainplan.js

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