lrf402788946 4 năm trước cách đây
mục cha
commit
00326efaaa
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      app/service/users/person_room.js

+ 3 - 1
app/service/users/person_room.js

@@ -22,8 +22,9 @@ class Person_roomService extends CrudService {
     let data = await this.model.find(condition).skip(parseInt(skip)).limit(parseInt(limit));
     if (data.length > 0) data = JSON.parse(JSON.stringify(data));
     // const notRead = await this.pc.find({ room_id: data.map(i => i._id), is_read: false, receiver_id: p_id });
+    // is_read: false,
     const aggQuery = [
-      { $match: { room_id: data.map(i => i._id), is_read: false, receiver_id: p_id } },
+      { $match: { room_id: data.map(i => i._id), receiver_id: p_id } },
       {
         $group: {
           _id: '$room_id',
@@ -31,6 +32,7 @@ class Person_roomService extends CrudService {
         },
       },
     ];
+    console.log(aggQuery);
     const r = await this.pc.aggregate(aggQuery);
     console.log(r);
     const total = await this.model.count(condition);