lrf402788946 4 rokov pred
rodič
commit
7401e1e1ff
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      app/service/patient.js

+ 3 - 3
app/service/patient.js

@@ -16,10 +16,10 @@ class PatientService extends CrudService {
     this.chatModel = this.ctx.model.Chat;
   }
 
-  async query({ doctorid }, { skip, limit }) {
+  async query({ doctorid, ...query }, { skip, limit }) {
     assert(doctorid, 'doctorid不能为空');
-    const pdocall = await this.pDocs.find({ doctorid });
-    const pdoc = await this.pDocs.find({ doctorid }).limit(limit).skip(skip);
+    const pdocall = await this.pDocs.find({ doctorid, ...query });
+    const pdoc = await this.pDocs.find({ doctorid, ...query }).limit(limit).skip(skip);
     const patients = [];
     for (const el of pdoc) {
       const patient = await this.model.findById(el.patientid);