浏览代码

根据学生id查询组详情

reloaded 5 年之前
父节点
当前提交
fa131b4158
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/service/group.js

+ 2 - 1
app/service/group.js

@@ -67,7 +67,8 @@ class GroupService extends CrudService {
 
   async findbystuid(data) {
     const { stuid } = data;
-    const groups = await this.model.find();
+    const _student = await this.smodel.findById(stuid);
+    const groups = await this.model.find({ classid: _student.classid });
     let result;
     for (const group of groups) {
       const students = group.students;