限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >开发者 >网站框架 >后端框架 >ThinkPHP

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

分类:ThinkPHP时间:2019-11-14浏览:2730
$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/500
Share your thoughts respectfully.