Commit 96afd609 authored by cq990612's avatar cq990612

修改

parent 4e52601c
......@@ -213,13 +213,30 @@ WHERE
u.id 'userId',
a.real_name ,
u.rank,
a.id_number,
u.phone,
if(ur.totalRecharge is NULL,0.00, round(ur.totalRecharge,2)) 'totalRecharge',
if(uw.totalWithdrawal is NULL,0.00,round(uw.totalWithdrawal,2)) 'totalWithdrawal',
u.parent_id,
aa.real_name 'parentName'
FROM users u
LEFT JOIN actives a ON u.id = a.user_id
LEFT JOIN actives aa ON u.parent_id = aa.user_id
LEFT JOIN (
SELECT user_id,round(SUM(amount),2) 'totalRecharge'
FROM user_recharge
WHERE user_id in (SELECT id from users WHERE parent_id = #{userId}) and status = 1
GROUP BY user_id
) ur ON ur.user_id=u.id
LEFT JOIN (
SELECT user_id,round(SUM(amount),2) 'totalWithdrawal'
FROM user_withdraws
WHERE user_id in (SELECT id from users WHERE parent_id = #{userId}) and status = 1
GROUP BY user_id
) uw ON uw.user_id=u.id
WHERE
u.parent_id = #{userId}
ORDER BY u.id
</select>
</mapper>
......@@ -22,9 +22,23 @@ public class UserSimpleInfoDto {
@ApiModelProperty(name = "rank", value = "层级")
private Integer rank;
@ApiModelProperty(name = "idNumber",value = "身份证号")
private String idNumber;
@ApiModelProperty(name = "phone", value = "用户手机号")
private String phone;
@ApiModelProperty(name = "totalRecharge", value = "充值总额")
private String totalRecharge;
@ApiModelProperty(name = "totalWithdrawal", value = "提现总额")
private String totalWithdrawal;
@ApiModelProperty(name = "parentId", value = "直接上级id")
private Integer parentId;
@ApiModelProperty(name = "parentName", value = "直接上级姓名")
private String parentName;
}
......@@ -26,7 +26,7 @@ public class TestUserController2 extends BaseController {
@Autowired
private TestUserService testUserService;
@ApiOperation(value = "获取下一级用户得信息", notes = "获取下一级用户得信息", httpMethod = "GET")
@ApiOperation(value = "获取下一级用户的信息", notes = "获取下一级用户的信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "int")
@GetMapping("/users/getDownUsersInfoById")
public R<List<UserSimpleInfoDto>> getDownUserInfoById(Long userId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment