FIX: notify on bronze popular link and nice share

This commit is contained in:
Sam Saffron 2016-03-17 10:33:34 +11:00
parent 433fa74d87
commit 14a77aa1e0
1 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ SQL
def self.sharing_badge(count) def self.sharing_badge(count)
<<SQL <<SQL
SELECT views.user_id, i2.post_id, i2.created_at granted_at SELECT views.user_id, i2.post_id, current_timestamp granted_at
FROM FROM
( (
SELECT i.user_id, MIN(i.id) i_id SELECT i.user_id, MIN(i.id) i_id
@ -263,7 +263,7 @@ SQL
def self.linking_badge(count) def self.linking_badge(count)
<<-SQL <<-SQL
SELECT tl.user_id, post_id, MIN(tl.created_at) granted_at SELECT tl.user_id, post_id, current_timestamp granted_at
FROM topic_links tl FROM topic_links tl
JOIN posts p ON p.id = post_id AND p.deleted_at IS NULL JOIN posts p ON p.id = post_id AND p.deleted_at IS NULL
JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message' JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'