|
@@ -54,6 +54,16 @@ export class PatentService extends BaseService<modelType> {
|
|
|
@Inject()
|
|
|
redisService: RedisService;
|
|
|
|
|
|
+ // 个人专利查询
|
|
|
+ async personQuery(query) {
|
|
|
+ const { user_id, name } = query;
|
|
|
+ const info: any = {};
|
|
|
+ if (user_id) info.users = { $elemMatch: { user_id } };
|
|
|
+ if (name) info.name = { $regex: name };
|
|
|
+ const result = await this.model.find(info);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
async beforeQuery(query) {
|
|
|
const _id = _.get(this.ctx.user, '_id');
|
|
|
const type = _.get(this.ctx.user, 'type');
|