社区动态首页

数据统计

image01.png image01.png

  • 动态总数(个):平台所有发布的帖子的数量之和;
select count(*) from memos 
where destroy_status is null and hidden=0 and published_at is not null and root_id is null;
/*
destroy_status=0表示已删除
hidden=1 表示隐藏,hidden=0表示未隐藏
published_at有值表示已审核通过
root_id不为空表示帖子,有值表示帖子评论
*/
  • 参与人数(人):平台所有发帖的人数之和;
select count(distinct author_id) from memos 
where destroy_status is null and hidden=0 and published_at is not null and root_id is null;
  • 访问次数(次):平台帖子的浏览次数之和和;
select count(viewed_count) from memos 
where destroy_status is null and hidden=0 and published_at is not null and root_id is null;

我要发帖

  • 游客点击“我要发帖”,弹出登录弹窗;
  • 已登录用户点击“我要发帖”,跳转到新建帖子页面;

置顶帖子

  • 显示置顶前3的帖子,点击跳转到帖子详情页。
    • 默认取接口/api/v1/memos.json?page=1&sort=sticky&limit=3&sticky=true memos前3条数据;
    • 当前一条置顶帖子都没有,则该模块隐藏;
  • 点击置顶的帖子标题,跳转到帖子详情页面;

板块数据

image02.png image02.png

取值逻辑

  • 默认取接口返回的板块(一级板块),接口/api/v1/forum_sections.json?is_detail=true
  • “全部”板块取所有板块下的帖子;
  • “专家智享”是单独写死的模块,不是从板块配置取值;