feat:h5推广中心页面 -> 下级用户列表增加一列,展示用户余额
This commit is contained in:
parent
efdf3092e5
commit
bd6f95560c
1 changed files with 7 additions and 3 deletions
|
|
@ -661,13 +661,15 @@
|
|||
select u.user_id as userId,u.user_name as userName,u.avatar,u.create_time as createTime,
|
||||
<if test="type==1">
|
||||
(select ifnull(sum(o.zhi_rate),0.00) from orders o where
|
||||
o.user_id = u.user_id and o.state=2 and zhi_user_id=#{userId} ) as money
|
||||
o.user_id = u.user_id and o.state=2 and zhi_user_id=#{userId} ) as money,
|
||||
</if>
|
||||
<if test="type==2">
|
||||
(select ifnull(sum(o.fei_rate),0.00) from orders o where
|
||||
o.user_id = u.user_id and o.state=2 and fei_user_id=#{userId} ) as money
|
||||
o.user_id = u.user_id and o.state=2 and fei_user_id=#{userId} ) as money,
|
||||
</if>
|
||||
ifnull(um.money, 0.00) as balance
|
||||
from tb_user u
|
||||
left join user_money um on u.user_id = um.user_id
|
||||
where
|
||||
<if test="type==1">
|
||||
inviter_code=#{invitationCode}
|
||||
|
|
@ -685,7 +687,8 @@
|
|||
u.user_name AS userName,
|
||||
u.avatar,
|
||||
u.create_time AS createTime,
|
||||
o.money
|
||||
o.money,
|
||||
ifnull(um.money, 0.00) as balance
|
||||
from (
|
||||
SELECT ifnull(sum(fei_rate), 0.00) as money, user_id
|
||||
FROM orders
|
||||
|
|
@ -693,6 +696,7 @@
|
|||
and fei_user_id = #{userId}
|
||||
GROUP BY user_id) o
|
||||
left join tb_user u on u.user_id = o.user_id
|
||||
left join user_money um on u.user_id = um.user_id
|
||||
) a
|
||||
order by money desc
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in a new issue