Fix Empty Months

This commit is contained in:
HojouFotytu 2024-04-14 08:36:18 +09:00
parent 4a2578761b
commit 763bf2eb31
1 changed files with 4 additions and 1 deletions

View File

@ -567,7 +567,10 @@ namespace Core.Main.DataObjects
if (extraSection != null) if (extraSection != null)
{ {
JArray monthlyStatsSection = (JArray)extraSection["monthlyStats"]; JArray monthlyStatsSection = (JArray)extraSection["monthlyStats"];
_monthlyStats = monthlyStatsSection.Select(j => BuildMonthlyStatsData(j as JObject)).ToList(); _monthlyStats = monthlyStatsSection
.Where(j => j["totalSales"] != null && (double)j["totalSales"] != 0 && j["avgGrowth"] != null)
.Select(j => BuildMonthlyStatsData(j as JObject))
.ToList();
_monthlyStatsRefresh = DateTime.UtcNow.AddSeconds(_systemConfiguration.GeneralSettings.Monitor.DashboardChartsRefreshSeconds - 1); _monthlyStatsRefresh = DateTime.UtcNow.AddSeconds(_systemConfiguration.GeneralSettings.Monitor.DashboardChartsRefreshSeconds - 1);
} }
} }