reloaded %!s(int64=5) %!d(string=hai) anos
pai
achega
8ee7cacf95
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/service/student.js

+ 2 - 2
app/service/student.js

@@ -15,9 +15,9 @@ class StudentService extends CrudService {
 
   // 查询
   async seek({ termid, skip, limit }) {
-    const students = await this.model.find({ termid, classid: null });
+    const students = await this.model.find({ termid, classid: null })
+    const data = await this.model.find({ termid, classid: null }).skip(Number(skip)).limit(Number(limit));
     const total = await students.length;
-    const data = students.skip(Number(skip)).limit(Number(limit));
     const result = { total, data };
     return result;
   }