|
@@ -13,6 +13,7 @@ class StudentService extends CrudService {
|
|
|
this.model = this.ctx.model.Student;
|
|
|
this.umodel = this.ctx.model.User;
|
|
|
this.tmodel = this.ctx.model.Trainplan;
|
|
|
+ this.clamodel = this.ctx.model.Class;
|
|
|
}
|
|
|
|
|
|
// 查询
|
|
@@ -31,6 +32,12 @@ class StudentService extends CrudService {
|
|
|
newdata.batchname = _batch.batch;
|
|
|
}
|
|
|
}
|
|
|
+ if (elm.classid) {
|
|
|
+ const classs = await this.clamodel.findById(elm.classid);
|
|
|
+ if (classs) {
|
|
|
+ newdata.classname = classs.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
data.push(newdata);
|
|
|
}
|
|
|
const result = { total, data };
|