mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	FIX: correct counts on user summary
This commit is contained in:
		@@ -30,8 +30,11 @@ class UserStat < ActiveRecord::Base
 | 
			
		||||
              (SELECT pt.user_id,
 | 
			
		||||
                      COUNT(*) AS c
 | 
			
		||||
               FROM users AS u
 | 
			
		||||
               INNER JOIN post_timings AS pt ON pt.user_id = u.id
 | 
			
		||||
               WHERE u.last_seen_at > :seen_at
 | 
			
		||||
               JOIN post_timings AS pt ON pt.user_id = u.id
 | 
			
		||||
               JOIN topics t ON t.id = pt.topic_id
 | 
			
		||||
               WHERE u.last_seen_at > :seen_at AND
 | 
			
		||||
                     t.archetype = 'regular' AND
 | 
			
		||||
                     t.deleted_at IS NULL
 | 
			
		||||
               GROUP BY pt.user_id) AS X
 | 
			
		||||
               WHERE X.user_id = user_stats.user_id AND
 | 
			
		||||
                     X.c <> posts_read_count
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user