|
@@ -90,15 +90,10 @@ 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) {
|
|
|
- const newdata = { ...JSON.parse(JSON.stringify(stu)), job: student.job };
|
|
|
- students_.push(newdata);
|
|
|
- }
|
|
|
+ if (student) stu.job = student.job;
|
|
|
}
|
|
|
- group.students = students_;
|
|
|
data.push(group);
|
|
|
}
|
|
|
return { total, data };
|