mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: dashboard posts report was including posts in daily data, but not in totals
This commit is contained in:
@ -622,6 +622,7 @@ class Post < ActiveRecord::Base
|
||||
|
||||
def self.public_posts_count_per_day(start_date, end_date, category_id = nil)
|
||||
result = public_posts.where('posts.created_at >= ? AND posts.created_at <= ?', start_date, end_date)
|
||||
.where(post_type: Post.types[:regular])
|
||||
result = result.where('topics.category_id = ?', category_id) if category_id
|
||||
result.group('date(posts.created_at)').order('date(posts.created_at)').count
|
||||
end
|
||||
|
Reference in New Issue
Block a user