From ebbbb47e67c2e9c98ed44e5531e476b24a41a81f Mon Sep 17 00:00:00 2001 From: Du Peng Date: Tue, 18 Oct 2022 12:44:19 +0200 Subject: [PATCH] (bug) cannot show order statstic --- app/frontend/src/javascript/controllers/admin/statistics.js | 3 ++- db/seeds.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/javascript/controllers/admin/statistics.js b/app/frontend/src/javascript/controllers/admin/statistics.js index 6a45242ce..cf84ce794 100644 --- a/app/frontend/src/javascript/controllers/admin/statistics.js +++ b/app/frontend/src/javascript/controllers/admin/statistics.js @@ -187,7 +187,8 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state', return ((tab.es_type_key === 'subscription' && !$rootScope.modules.plans) || (tab.es_type_key === 'training' && !$rootScope.modules.trainings) || (tab.es_type_key === 'space' && !$rootScope.modules.spaces) || - (tab.es_type_key === 'machine' && !$rootScope.modules.machines) + (tab.es_type_key === 'machine' && !$rootScope.modules.machines) || + (tab.es_type_key === 'order' && !$rootScope.modules.store) ); } else { return true; diff --git a/db/seeds.rb b/db/seeds.rb index bb8df5243..e3c1fcd4f 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,7 +12,8 @@ if StatisticIndex.count.zero? { id: 4, es_type_key: 'event', label: I18n.t('statistics.events') }, { id: 5, es_type_key: 'account', label: I18n.t('statistics.registrations'), ca: false }, { id: 6, es_type_key: 'project', label: I18n.t('statistics.projects'), ca: false }, - { id: 7, es_type_key: 'user', label: I18n.t('statistics.users'), table: false, ca: false } + { id: 7, es_type_key: 'user', label: I18n.t('statistics.users'), table: false, ca: false }, + { id: 8, es_type_key: 'order', label: I18n.t('statistics.orders') } ]) connection = ActiveRecord::Base.connection connection.execute("SELECT setval('statistic_indices_id_seq', 7);") if connection.instance_values['config'][:adapter] == 'postgresql'