|
@@ -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;
|