|
@@ -15,13 +15,13 @@ class PatentchatService extends CrudService {
|
|
|
|
|
|
async query({ id, is_read }, { skip = 0, limit = 0 } = {}) {
|
|
async query({ id, is_read }, { skip = 0, limit = 0 } = {}) {
|
|
assert(id, '缺少用户信息');
|
|
assert(id, '缺少用户信息');
|
|
- const data = await this.model.find({ $or: [{ sender_id: id }, { receiver_id: id }], is_read }).sort({ 'meta.createdAt': 1 }).skip(parseInt(skip))
|
|
|
|
|
|
+ const data = await this.model.find({ $or: [{ sender_id: id }, { receiver_id: id }, { is_read }] }).sort({ 'meta.createdAt': 1 }).skip(parseInt(skip))
|
|
.limit(parseInt(limit));
|
|
.limit(parseInt(limit));
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
async count({ id, is_read }) {
|
|
async count({ id, is_read }) {
|
|
assert(id, '缺少用户信息');
|
|
assert(id, '缺少用户信息');
|
|
- const data = await this.model.count({ $or: [{ sender_id: id }, { receiver_id: id }], is_read });
|
|
|
|
|
|
+ const data = await this.model.count({ $or: [{ sender_id: id }, { receiver_id: id }, { is_read }] });
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|