mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: Admin dashboard data for user profile views.
This commit is contained in:
parent
7acc93b2a0
commit
21725cc907
4 changed files with 18 additions and 0 deletions
|
@ -39,4 +39,9 @@ class UserProfileView < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def self.profile_views_by_day(start_date, end_date)
|
||||
profile_views = self.where("viewed_at >= ? AND viewed_at < ?", start_date, end_date + 1.day)
|
||||
profile_views.group("date(viewed_at)").order("date(viewed_at)").count
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue