|
@@ -63,12 +63,13 @@ class PatentinfoService extends CrudService {
|
|
|
return query;
|
|
|
}
|
|
|
|
|
|
- async queryByOrg({ id, skip = 0, limit = 0 }) {
|
|
|
- assert(id, '缺少机构信息');
|
|
|
- let pids = await this.personalModel.find({ pid: id }, { _id: 1 });
|
|
|
+ async queryByOrg({ code, status, skip = 0, limit = 0 }) {
|
|
|
+ assert(code, '缺少机构信息');
|
|
|
+ let pids = await this.personalModel.find({ code }, { _id: 1 });
|
|
|
if (pids.length <= 0) return { data: [], total: 0 };
|
|
|
pids = pids.map(i => i._id);
|
|
|
const query = { $elemMatch: { $in: pids } };
|
|
|
+ if (status) query.status = status;
|
|
|
const data = await this.model.find(query).skip(parseInt(skip)).limit(parseInt(limit))
|
|
|
.sort({ 'meta.createdAt': -1 });
|
|
|
const total = await this.model.count(query);
|