mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: adds last day to about page stats (#12663)
* FEATURE: adds last day to about page stats * make it clear it's last 24 hours * applies same copy fix to days
This commit is contained in:
@@ -63,20 +63,25 @@ class About
|
||||
|
||||
def stats
|
||||
@stats ||= {
|
||||
topic_count: Topic.listable_topics.count,
|
||||
post_count: Post.count,
|
||||
user_count: User.real.count,
|
||||
topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count,
|
||||
topics_30_days: Topic.listable_topics.where('created_at > ?', 30.days.ago).count,
|
||||
posts_7_days: Post.where('created_at > ?', 7.days.ago).count,
|
||||
posts_30_days: Post.where('created_at > ?', 30.days.ago).count,
|
||||
users_7_days: User.where('created_at > ?', 7.days.ago).count,
|
||||
users_30_days: User.where('created_at > ?', 30.days.ago).count,
|
||||
active_users_7_days: User.where('last_seen_at > ?', 7.days.ago).count,
|
||||
active_users_30_days: User.where('last_seen_at > ?', 30.days.ago).count,
|
||||
like_count: UserAction.where(action_type: UserAction::LIKE).count,
|
||||
likes_7_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 7.days.ago).count,
|
||||
likes_30_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 30.days.ago).count
|
||||
topic_count: Topic.listable_topics.count,
|
||||
topics_last_day: Topic.listable_topics.where('created_at > ?', 1.days.ago).count,
|
||||
topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count,
|
||||
topics_30_days: Topic.listable_topics.where('created_at > ?', 30.days.ago).count,
|
||||
post_count: Post.count,
|
||||
posts_last_day: Post.where('created_at > ?', 1.days.ago).count,
|
||||
posts_7_days: Post.where('created_at > ?', 7.days.ago).count,
|
||||
posts_30_days: Post.where('created_at > ?', 30.days.ago).count,
|
||||
user_count: User.real.count,
|
||||
users_last_day: User.real.where('created_at > ?', 1.days.ago).count,
|
||||
users_7_days: User.real.where('created_at > ?', 7.days.ago).count,
|
||||
users_30_days: User.real.where('created_at > ?', 30.days.ago).count,
|
||||
active_users_last_day: User.where('last_seen_at > ?', 1.days.ago).count,
|
||||
active_users_7_days: User.where('last_seen_at > ?', 7.days.ago).count,
|
||||
active_users_30_days: User.where('last_seen_at > ?', 30.days.ago).count,
|
||||
like_count: UserAction.where(action_type: UserAction::LIKE).count,
|
||||
likes_last_day: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 1.days.ago).count,
|
||||
likes_7_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 7.days.ago).count,
|
||||
likes_30_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 30.days.ago).count
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user