Prechádzať zdrojové kódy

根据学生id查询组详情

reloaded 5 rokov pred
rodič
commit
fa131b4158
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      app/service/group.js

+ 2 - 1
app/service/group.js

@@ -67,7 +67,8 @@ class GroupService extends CrudService {
 
 
   async findbystuid(data) {
   async findbystuid(data) {
     const { stuid } = 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;
     let result;
     for (const group of groups) {
     for (const group of groups) {
       const students = group.students;
       const students = group.students;