|
@@ -90,10 +90,15 @@ class GroupService extends CrudService {
|
|
|
const data = [];
|
|
|
for (const _group of res) {
|
|
|
const group = _.cloneDeep(JSON.parse(JSON.stringify(_group)));
|
|
|
+ const students_ = [];
|
|
|
for (const stu of group.students) {
|
|
|
const student = await this.smodel.findOne({ id: stu.stuid });
|
|
|
- if (student) stu.job = student.job;
|
|
|
+ if (student) {
|
|
|
+ const newdata = { ...JSON.parse(JSON.stringify(stu)), job: student.job };
|
|
|
+ students_.push(newdata);
|
|
|
+ }
|
|
|
}
|
|
|
+ group.students = students_;
|
|
|
data.push(group);
|
|
|
}
|
|
|
return { total, data };
|