liuyu 4 лет назад
Родитель
Сommit
3b02c4a786
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/service/student.js

+ 2 - 2
app/service/student.js

@@ -16,8 +16,8 @@ class StudentService extends CrudService {
 
   // 查询
   async seek({ termid, skip, limit }) {
-    const total = await this.model.count({ termid, classid: '' });
-    const data = await this.model.find({ termid, classid: '' }).skip(Number(skip)).limit(Number(limit));
+    const total = await this.model.count({ termid, $or: [{ classid: null }, { classid: '' }] });
+    const data = await this.model.find({ termid, $or: [{ classid: null }, { classid: '' }] }).skip(Number(skip)).limit(Number(limit));
     const result = { total, data };
     return result;
   }