mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Add email counts to admin dashboard
This commit is contained in:
@ -7,4 +7,8 @@ class EmailLog < ActiveRecord::Base
|
||||
# Update last_emailed_at if the user_id is present
|
||||
User.update_all("last_emailed_at = CURRENT_TIMESTAMP", id: user_id) if user_id.present?
|
||||
end
|
||||
|
||||
def self.count_per_day(since = 30.days.ago)
|
||||
where('created_at > ?', since).group('date(created_at)').order('date(created_at)').count
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user