$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");
点赞+问答+文章相加对用户进行排序
未经允许不得转载:王明昌博客 » 点赞+问答+文章相加对用户进行排序