guhongwei 3 年之前
父节点
当前提交
03822712ad
共有 1 个文件被更改,包括 13 次插入8 次删除
  1. 13 8
      app/service/statistics/index.js

+ 13 - 8
app/service/statistics/index.js

@@ -382,30 +382,35 @@ class IndexService extends CrudService {
   }
 
   async patentUserIndex({ id }) {
+    // 审核通知
     const patentExamine = this.ctx.model.Patent.Patentexamine;
+    // 未读消息
     const unread = await patentExamine.count({ to: id, is_read: false });
-
-
+    // 专利申请
     const papply = this.ctx.model.Patent.Patentapply;
     const apply = await papply.count({ status: [ '0', '1', '-1', '-2' ], user_id: id });
+    // 查询检索
     const palysis = this.ctx.model.Patent.Patentanalysis;
     const analysis = await palysis.count({ status: [ '0', '-1' ], user_id: id });
+    // 价值评估
     const paccess = this.ctx.model.Patent.Patentassess;
     const access = await paccess.count({ status: [ '0', '-1' ], user_id: id });
-
-
+    // 专利信息
     const patentInfo = this.ctx.model.Patent.Patentinfo;
     const information = await patentInfo.count({ user_id: { $elemMatch: { $in: [ ObjectId(id) ] } } });
+    // 专利维权
+    const patentsafeg = this.ctx.model.Patent.Patentsafeg;
+    const safeg = await patentsafeg.count({ status: [ '0', '1', '2' ], user_id: id });
+    // 专利预警
     const patentEarly = this.ctx.model.Patent.Patentearly;
     const early = await patentEarly.count({ user_id: { $elemMatch: { $in: [ ObjectId(id) ] } } });
-
-
+    // 专利交易
     const patentTrans = this.ctx.model.Patent.Patenttrans;
     const trans1 = await patentTrans.count({ type: '转让', user_id: id });
-    const trans2 = await patentTrans.count({ type: '合作', user_id: id });
+    const trans2 = await patentTrans.count({ type: '许可', user_id: id });
     const trans3 = await patentTrans.count({ type: '招商', user_id: id });
     return {
-      message: { unread }, apply: { apply, analysis, access }, patent: { information, early }, transaction: { trans1, trans2, trans3 },
+      message: { unread }, apply: { apply, analysis, access }, patent: { information, safeg, early }, transaction: { trans1, trans2, trans3 },
     };
   }