guhongwei преди 3 години
родител
ревизия
c73c0d7c7f
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      app/service/patent/patentinfo.js

+ 2 - 1
app/service/patent/patentinfo.js

@@ -63,13 +63,14 @@ class PatentinfoService extends CrudService {
     return query;
   }
 
-  async queryByOrg({ code, status, skip = 0, limit = 0 }) {
+  async queryByOrg({ code, status, term, skip = 0, limit = 0 }) {
     assert(code, '缺少机构信息');
     let pids = await this.personalModel.find({ code }, { _id: 1 });
     if (pids.length <= 0) return { data: [], total: 0 };
     pids = pids.map(i => i._id);
     const query = { user_id: { $elemMatch: { $in: pids } } };
     if (status) query.status = status;
+    if (term) query.term = term;
     const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
       .sort({ 'meta.createdAt': -1 });
     const total = await this.model.count(query);