ruifeng_liu 3 年之前
父节点
当前提交
374aacae86
共有 3 个文件被更改,包括 5 次插入40 次删除
  1. 0 15
      app/controller/statistics/index.js
  2. 0 3
      app/router/statistics/index.js
  3. 5 22
      app/service/statistics/index.js

+ 0 - 15
app/controller/statistics/index.js

@@ -98,21 +98,6 @@ class IndexController extends Controller {
     this.ctx.ok({ data });
   }
 
-  // 我的申请
-  async getMyApply() {
-    const data = await this.service.getMyApply(this.ctx.query);
-    this.ctx.ok({ data });
-  }
-  // 获取我的专利
-  async getMyPatent() {
-    const data = await this.service.getMyPatent(this.ctx.query);
-    this.ctx.ok({ data });
-  }
-  // 获取我的交易信息
-  async getMyTransaction() {
-    const data = await this.service.getMyTransaction(this.ctx.query);
-    this.ctx.ok({ data });
-  }
 
 }
 module.exports = CrudController(IndexController, meta);

+ 0 - 3
app/router/statistics/index.js

@@ -19,8 +19,5 @@ module.exports = app => {
   router.get(target, `${profix}${vision}/${index}/${target}/declare`, controller[index][target].declare);
   router.get(target, `${profix}${vision}/${index}/${target}/patentUserIndex`, controller[index][target].patentUserIndex);
 
-  router.get(target, `${profix}${vision}/${index}/${target}/getMyApply`, controller[index][target].getMyApply);
-  router.get(target, `${profix}${vision}/${index}/${target}/getMyPatent`, controller[index][target].getMyPatent);
-  router.get(target, `${profix}${vision}/${index}/${target}/getMyTransaction`, controller[index][target].getMyTransaction);
 
 };

+ 5 - 22
app/service/statistics/index.js

@@ -384,46 +384,29 @@ class IndexService extends CrudService {
   async patentUserIndex({ id }) {
     const patentExamine = this.ctx.service.patent.patentexamine;
     const unread = await patentExamine.count({ id, is_read: false });
-    return { unread };
-  }
 
-  /**
-   * 我的申请
-   * @param {String} param0 id
-   */
-  async getMyApply({ id }) {
+
     const papply = this.ctx.patent.patentapply;
     const apply = await papply.count({ status: [ '0', '1', '-1', '2' ], user_id: id });
     const palysis = this.ctx.patent.patentanalysis;
     const analysis = await palysis.count({ status: [ '0', '-1' ], user_id: id });
     const paccess = this.ctx.patent.patentassess;
     const access = await paccess.count({ status: [ '0', '-1' ], user_id: id });
-    return { apply, analysis, access };
-  }
 
-  /**
-   * 获取我的专利
-   * @param {String} param0 id
-   */
-  async getMyPatent({ id }) {
+
     const patentInfo = this.ctx.patent.patentinfo;
     const information = await patentInfo.count({ user_id: [ id ] });
     const patentEarly = this.ctx.patent.patentearly;
     const early = await patentEarly.count({ user_id: [ id ] });
-    return { information, early };
-  }
 
-  /**
-   * 获取我的交易信息
-   * @param {String} param0 id
-   */
-  async getMyTransaction({ id }) {
+
     const patentTrans = this.ctx.patent.patenttrans;
     const trans1 = 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 { trans1, trans2, trans3 };
+    return { unread, apply, analysis, access, information, early, trans1, trans2, trans3 };
   }
+
 }
 
 module.exports = IndexService;