lrf402788946 4 年之前
父節點
當前提交
484e898fc5
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      app/service/class.js

+ 9 - 9
app/service/class.js

@@ -166,15 +166,15 @@ class ClassService extends CrudService {
     // }
     // }
 
 
     // 更新学生的班级
     // 更新学生的班级
-    // const ckeys = Object.keys(result);
-    // for (const classid of ckeys) {
-    //   await this.stumodel.updateMany({ _id: result[classid] }, { classid });
-    // }
-    // // 新添,给学生排序号
-    // const claList = await this.model.find({ termid });
-    // for (const cla of claList) {
-    //   await this.ctx.service.student.arrangeNumber({ classid: cla._id });
-    // }
+    const ckeys = Object.keys(result);
+    for (const classid of ckeys) {
+      await this.stumodel.updateMany({ _id: result[classid] }, { classid });
+    }
+    // 新添,给学生排序号
+    const claList = await this.model.find({ termid });
+    for (const cla of claList) {
+      await this.ctx.service.student.arrangeNumber({ classid: cla._id });
+    }
   }
   }
 
 
   /**
   /**