mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: show private message topic count on admin dashboard reports
This commit is contained in:
@ -191,6 +191,8 @@ class Topic < ActiveRecord::Base
|
||||
where("topics.category_id IS NULL OR topics.category_id IN (SELECT id FROM categories WHERE #{condition[0]})", condition[1])
|
||||
}
|
||||
|
||||
scope :with_subtype, ->(subtype) { where('topics.subtype = ?', subtype) }
|
||||
|
||||
attr_accessor :ignore_category_auto_close
|
||||
attr_accessor :skip_callbacks
|
||||
|
||||
@ -1307,6 +1309,10 @@ SQL
|
||||
MiniSuffix.domain(URI.parse(URI.encode(self.featured_link)).hostname)
|
||||
end
|
||||
|
||||
def self.private_message_topics_count_per_day(start_date, end_date, topic_subtype)
|
||||
private_messages.with_subtype(topic_subtype).where('topics.created_at >= ? AND topics.created_at <= ?', start_date, end_date).group('date(topics.created_at)').order('date(topics.created_at)').count
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_category_topic_count_by(num)
|
||||
|
Reference in New Issue
Block a user