ruifeng_liu hace 3 años
padre
commit
dc63be22f4
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      app/service/patent/patentinfo.js

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

@@ -9,6 +9,7 @@ const fs = require('fs');
 const { CrudService } = require('naf-framework-mongoose/lib/service');
 const { BusinessError, ErrorCode } = require('naf-core').Error;
 const { trimData } = require('naf-core').Util;
+const { ObjectId } = require('mongoose').Types;
 
 // 专利信息
 class PatentinfoService extends CrudService {
@@ -60,7 +61,7 @@ class PatentinfoService extends CrudService {
         delete query.code;
       }
     } else if (user_id) {
-      query.user_id = { $elemMatch: { $in: [ user_id ] } };
+      query.user_id = { $elemMatch: { $in: [ ObjectId(user_id) ] } };
     }
 
     return query;