|
@@ -48,6 +48,22 @@ export class UtilService {
|
|
|
@Config('PathConfig.path')
|
|
|
path;
|
|
|
|
|
|
+ // 统计总数
|
|
|
+ async toTotal() {
|
|
|
+ const companyTotal = await this.companyModel.count();
|
|
|
+ const supplyTotal = await this.supplyModel.count();
|
|
|
+ const demandTotal = await this.demandModel.count();
|
|
|
+ const projectTotal = await this.projectModel.count();
|
|
|
+ const achievementTotal = await this.achievementModel.count();
|
|
|
+ const data = [
|
|
|
+ { id: '1', name: '企业', num: `${companyTotal}+`, unit: '家' },
|
|
|
+ { id: '2', name: '供给', num: `${supplyTotal}+`, unit: '个' },
|
|
|
+ { id: '3', name: '需求', num: `${demandTotal}+`, unit: '个' },
|
|
|
+ { id: '4', name: '项目', num: `${projectTotal}+`, unit: '个' },
|
|
|
+ { id: '5', name: '成果', num: `${achievementTotal}+`, unit: '个' },
|
|
|
+ ];
|
|
|
+ return data;
|
|
|
+ }
|
|
|
// 导出
|
|
|
async toExport(query) {
|
|
|
const { table, config, user } = query;
|