|
@@ -145,19 +145,28 @@ class IndexService extends CrudService {
|
|
const res = await this.ctx.model.Ticket.aggregate([
|
|
const res = await this.ctx.model.Ticket.aggregate([
|
|
{ $group: {
|
|
{ $group: {
|
|
_id: '$status',
|
|
_id: '$status',
|
|
- count: { $sum: 1 },
|
|
|
|
|
|
+ value: { $sum: 1 },
|
|
} },
|
|
} },
|
|
]);
|
|
]);
|
|
-
|
|
|
|
const data = statusList.map(i => {
|
|
const data = statusList.map(i => {
|
|
- const { label, value } = i;
|
|
|
|
|
|
+ const { label: name, value } = i;
|
|
const r = res.find(f => f._id === value);
|
|
const r = res.find(f => f._id === value);
|
|
- const obj = { label, value: 0 };
|
|
|
|
|
|
+ const obj = { name, value: 0 };
|
|
if (r) obj.value = r.value;
|
|
if (r) obj.value = r.value;
|
|
return obj;
|
|
return obj;
|
|
});
|
|
});
|
|
- return data;
|
|
|
|
|
|
+ // 政策服务
|
|
|
|
+ // 高企认定(ticket);奖励兑现(policy);研发补贴(policy)
|
|
|
|
+ const tcount = await this.ctx.model.Ticket.count();
|
|
|
|
+ const jldx = await this.ctx.model.Policy.count({ type: '奖励兑现' });
|
|
|
|
+ const yfbt = await this.ctx.model.Policy.count({ type: '研发补贴' });
|
|
|
|
+ const arr = [];
|
|
|
|
+ arr.push({ name: '高企认定', value: tcount });
|
|
|
|
+ arr.push({ name: '奖励兑现', value: jldx });
|
|
|
|
+ arr.push({ name: '研发补贴', value: yfbt });
|
|
|
|
+ return { ticket: data, policy: arr };
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = IndexService;
|
|
module.exports = IndexService;
|