guhongwei il y a 2 ans
Parent
commit
cb61751f64
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      app/service/notice.js

+ 1 - 1
app/service/notice.js

@@ -15,7 +15,7 @@ class NoticeService extends CrudService {
   }
   async query({ user_id, ...query }, { skip = 0, limit = 0 } = {}) {
     const condition = { ...query };
-    if (user_id) condition.receive_user = { $elemMatch: { user_id: ObjectId(user_id) } };
+    if (user_id) condition.receive_user = { $elemMatch: { user_id } };
     const data = await this.model.find(condition).skip(parseInt(skip)).limit(parseInt(limit));
     if (data.length === 0) throw new BusinessError(ErrorCode.DATA_NOT_EXIST);
     return data;