ruifeng_liu 3 years ago
parent
commit
148bec8020
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/service/patent/patentnotice.js

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

@@ -17,6 +17,7 @@ class PatentnoticeService extends CrudService {
 
 
   async query(query, { skip = 0, limit = 0 } = 0) {
   async query(query, { skip = 0, limit = 0 } = 0) {
     query = await this.resetQuery(query);
     query = await this.resetQuery(query);
+    console.log(query);
     const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
     const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
       .sort({ 'meta.createdAt': -1 });
       .sort({ 'meta.createdAt': -1 });
     return data;
     return data;
@@ -70,7 +71,7 @@ class PatentnoticeService extends CrudService {
         const p1 = await this.getOrgUser(admin.code);
         const p1 = await this.getOrgUser(admin.code);
         const p2 = await this.getOrgUser(org.map(i => i.code));
         const p2 = await this.getOrgUser(org.map(i => i.code));
         let ids = [ ...p1.map(i => i._id), ...p2.map(i => i._id) ];
         let ids = [ ...p1.map(i => i._id), ...p2.map(i => i._id) ];
-        if (to_type === 0) {
+        if (to_type === '0') {
           ids = [ ...ids, ...org.map(i => i._id) ];
           ids = [ ...ids, ...org.map(i => i._id) ];
         }
         }
         object = { send_id, send_name, to_type, to_id: ids, content };
         object = { send_id, send_name, to_type, to_id: ids, content };