ruifeng_liu пре 3 година
родитељ
комит
148bec8020
1 измењених фајлова са 2 додато и 1 уклоњено
  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) {
     query = await this.resetQuery(query);
+    console.log(query);
     const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
       .sort({ 'meta.createdAt': -1 });
     return data;
@@ -70,7 +71,7 @@ class PatentnoticeService extends CrudService {
         const p1 = await this.getOrgUser(admin.code);
         const p2 = await this.getOrgUser(org.map(i => i.code));
         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) ];
         }
         object = { send_id, send_name, to_type, to_id: ids, content };