1.排行榜查询数据不准确修复

This commit is contained in:
张松
2025-01-07 13:20:00 +08:00
parent 52f6016e39
commit a490541ccb
3 changed files with 19 additions and 22 deletions

View File

@@ -299,22 +299,7 @@
<select id="selectInviteUserList" resultType="com.sqx.modules.app.entity.UserEntity">
SELECT
u.*,
IFNULL( b.counts, 0 ) AS counts,
0 AS money
FROM
tb_user u
LEFT JOIN ( SELECT inviter_code, COUNT(*) AS counts FROM tb_user u1 GROUP BY inviter_code ) AS b ON u.invitation_code = b.inviter_code
WHERE
1 = 1
<if test="userName!=null and userName!=''">
and user_name like concat('%',#{userName},'%')
</if>
<if test="phone!=null and phone!=''">
and phone like concat('%',#{phone},'%')
</if>
order by money desc,counts desc
SELECT any_value(user_id) as userId, COUNT(*) AS counts FROM tb_user GROUP BY inviter_code order by counts desc
</select>
<select id="selectUserOnLineCount" resultType="Integer">