|
@@ -62,15 +62,6 @@ class StudentService extends CrudService {
|
|
|
|
|
|
// 查询
|
|
|
async query({ skip, limit, ...info }) {
|
|
|
- const { termid, classid } = info;
|
|
|
- if (!classid) {
|
|
|
- const classes = await this.clamodel.find({ termid });
|
|
|
- for (const cla of classes) {
|
|
|
- await this.arrangeNumber(cla._id);
|
|
|
- }
|
|
|
- } else {
|
|
|
- await this.arrangeNumber(classid);
|
|
|
- }
|
|
|
const total = await this.model.count(info);
|
|
|
const res = await this.model
|
|
|
.find(info)
|
|
@@ -400,7 +391,7 @@ class StudentService extends CrudService {
|
|
|
}
|
|
|
|
|
|
// 将学生排号
|
|
|
- async arrangeNumber(classid) {
|
|
|
+ async arrangeNumber({ classid }) {
|
|
|
const studList = await this.model.find({ classid });
|
|
|
let number = 1;
|
|
|
// 查每个学生的编号,如果没有,就给赋上值;有,就给number赋上值,然后继续下一位
|
|
@@ -414,7 +405,7 @@ class StudentService extends CrudService {
|
|
|
}
|
|
|
number = number * 1 + 1;
|
|
|
}
|
|
|
- // console.log(`last number => ${number}`);
|
|
|
+ number = 1;
|
|
|
}
|
|
|
|
|
|
// 导出学生 目前:拓展训练保险用
|