|
@@ -15,11 +15,11 @@ class ClassService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async divide(data) {
|
|
|
- const termid = await data.termid;
|
|
|
- const batchid = await data.batchid;
|
|
|
const name = await data.classname;
|
|
|
const number = await data.students.length;
|
|
|
const type = await data.type;
|
|
|
+ const termid = await data.termid;
|
|
|
+ const batchid = await data.batchid;
|
|
|
const classdata = { name, batchid, termid, number, type };
|
|
|
// 根据班级名称查询班级是否已存在
|
|
|
const newclass = await this.model.findOne({ name });
|
|
@@ -37,6 +37,7 @@ class ClassService extends CrudService {
|
|
|
const student = await this.stumodel.findById(studentid);
|
|
|
student.classid = classid;
|
|
|
student.batchid = batchid;
|
|
|
+ student.termid = termid;
|
|
|
await student.save();
|
|
|
}
|
|
|
}
|