From fff118ac710285a7d4275951bddd5c45dc025538 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 3 Mar 2020 21:27:28 +0800 Subject: [PATCH] fix error --- temp_file/app/helpers/orbit_backend_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temp_file/app/helpers/orbit_backend_helper.rb b/temp_file/app/helpers/orbit_backend_helper.rb index 790cf6a..e1da325 100644 --- a/temp_file/app/helpers/orbit_backend_helper.rb +++ b/temp_file/app/helpers/orbit_backend_helper.rb @@ -134,10 +134,10 @@ module OrbitBackendHelper visitors_this_month = Rails.cache.fetch("visitors_this_month", expires_in: 1.day) do display_visitors(created_at: {'$gte' => Time.now.beginning_of_month}) end + visitors_this_month else @result_of_thirty_day[0..((Time.now-Time.now.beginning_of_month)/86400).floor].map{|v| v['count']}.reduce{|v,x| v+x} end - visitors_this_month end def display_visitors_this_year