|
@@ -15,6 +15,7 @@ class BedroomService extends CrudService {
|
|
|
this.tmodel = this.ctx.model.Trainplan;
|
|
|
this.cmodel = this.ctx.model.Class;
|
|
|
this.umodel = this.ctx.model.User;
|
|
|
+ this.ctmodel = this.ctx.model.Classtype;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -139,7 +140,9 @@ class BedroomService extends CrudService {
|
|
|
// 取得符合条件的学生列表
|
|
|
async getstudents(termid, batchid) {
|
|
|
// 根据期id查找所有当期学生列表
|
|
|
- const studentList = await this.smodel.find({ termid, batchid }).sort({ gender: -1 });
|
|
|
+ const cltype = await this.ctmodel.find({ bedroom: '0' });
|
|
|
+ const types = _.map(cltype, 'code');
|
|
|
+ const studentList = await this.smodel.find({ termid, batchid, type: { $in: types } }).sort({ gender: -1 });
|
|
|
return studentList;
|
|
|
}
|
|
|
|