2020-10-29 12:49:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Reports::MobileVisits
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
class_methods do
|
|
|
|
def report_mobile_visits(report)
|
|
|
|
basic_report_about report, UserVisit, :mobile_by_day, report.start_date, report.end_date
|
|
|
|
report.total = UserVisit.where(mobile: true).count
|
|
|
|
report.prev30Days =
|
|
|
|
UserVisit
|
|
|
|
.where(mobile: true)
|
|
|
|
.where(
|
|
|
|
"visited_at >= ? and visited_at < ?",
|
|
|
|
report.start_date - 30.days,
|
|
|
|
report.start_date,
|
2023-01-09 07:20:10 -05:00
|
|
|
)
|
2020-10-29 12:49:09 -04:00
|
|
|
.count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|