From 8d0c326bbcbe68998aa9ae1f701839a5087e8445 Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 8 Aug 2014 17:52:40 +0800 Subject: [PATCH] remove distinct in dashboard monthly traffic counting --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a1bf835..aa8d5f8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -257,7 +257,7 @@ module ApplicationHelper visits = Impression.where( created_at: { '$gte' => Time.now.beginning_of_day-i.days, '$lte' => Time.now.end_of_day-i.days} - ).distinct(:request_hash).count + ).count site.month_traffic_cache['result'].push([ Time.now.beginning_of_day-i.days, visits]) end