ruifeng_liu 3 年之前
父节点
当前提交
0afe5d00ae
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/service/patent/patentnotice.js

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

@@ -4,6 +4,7 @@ const { BusinessError, ErrorCode } = require('naf-core').Error;
 const _ = require('lodash');
 const assert = require('assert');
 const { trimData } = require('naf-core').Util;
+const { ObjectId } = require('mongoose').Types;
 
 // 通知
 class PatentnoticeService extends CrudService {
@@ -30,7 +31,7 @@ class PatentnoticeService extends CrudService {
   async resetQuery(condition) {
     const { to_id } = condition;
     if (to_id) {
-      condition.to_id = { $elemMatch: { $in: [ to_id ] } };
+      condition.to_id = { $elemMatch: { $in: [ ObjectId(to_id) ] } };
     }
     return condition;
   }