Discourse会追踪连续活跃天数吗?

我们的 Discourse 论坛的一位成员询问 Discourse 是否有方法显示/识别在 Discourse 论坛上连续访问或发帖的天数。我在管理员的用户信息中没有看到任何此类信息,它被保存在哪里了吗?

供参考,Reddit 有此功能。

1 个赞

是的,因为有“Enthusiast”(爱好者)、“Aficionado”(狂热者)和“Devotee”(信徒)等徽章,它们是针对连续访问天数。据我回忆,“visited”(访问)是指点赞帖子/回复过一次。

3 个赞

你也许可以做一个数据探索查询。user_visits 表的 schema 在这里:

也许像这样?:thinking:

WITH consecutive_visits AS (
    SELECT
        user_id,
        visited_at,
        visited_at - INTERVAL '1 day' * ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY visited_at) AS grp
    FROM
        user_visits
),
visit_streaks AS (
    SELECT
        user_id,
        COUNT(*) AS streak_length
    FROM
        consecutive_visits
    GROUP BY
        user_id, grp
)
SELECT
    user_id,
    MAX(streak_length) AS longest_streak
FROM
    visit_streaks
GROUP BY
    user_id
ORDER BY
    longest_streak DESC
LIMIT 100

或者也许你可以结合 user_actions 表(带有点赞和帖子的访问记录?),它在这里:

3 个赞

谢谢,我会记住的。

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.