|
@@ -33,7 +33,13 @@ class StudentService extends CrudService {
|
|
|
|
|
|
// 查询
|
|
|
async query({ skip, limit, ...info }) {
|
|
|
- await this.arrangeNumber();
|
|
|
+ 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)
|