@southpaw 抓到你了;我正要发 ![]()
如果你有兴趣,我添加了可以填写的自定义字段:
--[params]
-- int_list :category_ids
-- text :interval = 20min
SELECT t.category_id, count(pa.id) count
from post_actions pa
INNER JOIN posts p on p.id = pa.post_id
INNER JOIN topics t on t.id = p.topic_id
WHERE post_action_type_id in (3, 4, 6, 7, 8)
AND t.category_id in (:category_ids)
AND pa.created_at >= now() - interval :interval
GROUP BY t.category_id
你可以输入多个分类 ID 和自定义间隔(例如 1h、30 min、3 months 等)
注意:我保留了 the post_action_type_id 6,我认为这与用户收到警告有关;我不确定你是否也想计数;如果不想,请随时删除它。
