有没有办法授予创建主题的人徽章,该主题随后获得了许多回复?比如 100 个回复?
我称之为“热门主题”,它将鼓励人们思考能够产生大量讨论的新主题创意。
有没有办法授予创建主题的人徽章,该主题随后获得了许多回复?比如 100 个回复?
我称之为“热门主题”,它将鼓励人们思考能够产生大量讨论的新主题创意。
我认为一个简单的版本可能是这样的:
SELECT
t.user_id,
CURRENT_TIMESTAMP AS granted_at,
p.id AS post_id
FROM topics t
JOIN posts p ON p.topic_id = t.id AND p.post_number = 1
WHERE t.posts_count >= 100
AND t.archetype = 'regular'
AND t.deleted_at ISNULL
AND t.user_id > 0
使用 t.post_counts 目前还将包括小的操作帖子(已关闭、未列出等),因此这取决于您希望它有多准确。
您可以通过在查询中计算“符合条件”的帖子来使其更具体。例如:
SELECT
t.user_id,
CURRENT_TIMESTAMP AS granted_at,
p.id AS post_id
FROM topics t
JOIN posts p ON p.topic_id = t.id AND p.post_number = 1
WHERE t.id IN (
SELECT
p.topic_id
FROM posts p
JOIN topics t ON t.id = p.topic_id
WHERE t.archetype = 'regular'
AND t.deleted_at IS NULL
AND p.deleted_at IS NULL
AND p.post_number <> 1
AND p.post_type = 1
AND p.hidden IS FALSE
GROUP BY 1
HAVING COUNT(*) >= 100
)
好的,我会试试看,然后回复你!
我已经设置好了,但我想它应该设置为每天更新?我明天看看是否有效。“目标帖子”需要勾选吗?
太棒了,谢谢!!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.