欢迎光临
感谢一路有你

点赞+问答+文章相加对用户进行排序

$list = Db::query("SELECT
            u.*,
            (select count(1) FROM zf_post where uid=u.id and `status`=1) as p_count,
            (select count(1) FROM zf_like where uid=u.id) as l_count,
            (select count(1) FROM zf_comment where uid=u.id) as c_count
            FROM
                zf_user u
            GROUP BY p_count+l_count+c_count DESC");

赞(0) 打赏
未经允许不得转载:王明昌博客 » 点赞+问答+文章相加对用户进行排序
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

隐藏
变装