mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 03:09:43 +00:00
FIX: Liked posts based badges were looking at all likes
This commit is contained in:
parent
e4980392da
commit
bb25200745
@ -240,9 +240,12 @@ SQL
|
|||||||
<<-SQL
|
<<-SQL
|
||||||
SELECT us.user_id, current_timestamp AS granted_at
|
SELECT us.user_id, current_timestamp AS granted_at
|
||||||
FROM user_stats AS us
|
FROM user_stats AS us
|
||||||
WHERE us.likes_received >= #{likes_received}
|
INNER JOIN posts AS p ON p.user_id = us.user_id
|
||||||
|
WHERE p.like_count > 0
|
||||||
AND us.likes_given >= #{likes_given}
|
AND us.likes_given >= #{likes_given}
|
||||||
AND (:backfill OR us.user_id IN (:user_ids))
|
AND (:backfill OR us.user_id IN (:user_ids))
|
||||||
|
GROUP BY us.user_id, us.likes_given
|
||||||
|
HAVING COUNT(*) > #{likes_received}
|
||||||
SQL
|
SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user