FIX: better handling of no prev30Days (#6301)

This commit is contained in:
Joffrey JAFFEUX
2018-08-22 18:00:11 +02:00
committed by GitHub
parent f01169d6ff
commit c08dea386b
5 changed files with 18 additions and 3 deletions

View File

@ -217,8 +217,9 @@ class Report
report.icon = 'user'
basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date, report.group_id
add_counts report, UserVisit, 'visited_at'
report.prev30Days = UserVisit.where(mobile: true).where("visited_at >= ? and visited_at < ?", report.start_date - 30.days, report.start_date).count
end
def self.report_mobile_visits(report)