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 };