lrf402788946 4 年之前
父节点
当前提交
0f1301105f
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      app/service/users/person_room.js

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

@@ -20,9 +20,7 @@ class Person_roomService extends CrudService {
       condition.$or = [{ p1_id: p_id }, { p2_id: p_id }];
     }
     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 });
-    console.log();
     const aggQuery = [
       { $match: { room_id: data.map(i => i._id), is_read: false, receiver_id: ObjectId(p_id) } },
       {
@@ -32,9 +30,9 @@ class Person_roomService extends CrudService {
         },
       },
     ];
-    console.log(aggQuery);
     const r = await this.pc.aggregate(aggQuery);
     console.log(r);
+    if (data.length > 0) data = JSON.parse(JSON.stringify(data));
     const total = await this.model.count(condition);
     return { data, total };
   }