phpcjl
2024-12-18 0406a3a2f3cfb2b081f4ca94352f19f301685c84
Merge remote-tracking branch 'origin/master'
2个文件已修改
45 ■■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -420,6 +420,7 @@
    }
    @GetMapping("/danger/info")
    @ApiOperation(value = "用户列表-保级条件详情", tags = {"管理后台"})
    public R<DangerInfoDto> dangerinfo(Long id)
@@ -480,6 +481,42 @@
        appUserService.updateById(byId);
        return R.ok();
    }
    @GetMapping("/select")
    @ApiOperation(value = "用户列表-查询绑定人", tags = {"管理后台"})
    public R<AppUser> select(String phone)
    {
        AppUser byId = appUserService.lambdaQuery().eq(AppUser::getPhone,phone).one();
        if (byId==null){
            return R.fail("搜索失败,手机号错误。");
        }
        return R.ok(byId);
    }
    @GetMapping("/change/bind")
    @ApiOperation(value = "用户列表-更换绑定人", tags = {"管理后台"})
    public R<AppUser> select(Long id,Long inviteId)
    {
        AppUser byId = appUserService.getById(id);
        byId.setInviteUserId(inviteId);
        byId.setTopInviteId(getTop(inviteId));
        appUserService.updateById(byId);
        return R.ok();
    }
    public  Long getTop(Long inviteId){
        AppUser byId = appUserService.getById(inviteId);
        if (byId!=null){
            return getTop(byId.getInviteUserId());
        }else {
            return inviteId;
        }
    }
    @Resource
    private ShopClient shopClient;
    @Resource
@@ -514,6 +551,7 @@
        if (lastOrder.getData()!=null){
            byId.setLastOrderTime(lastOrder.getData().getCreateTime());
        }
        //消费总金额
        return R.ok(byId);
    }
    @GetMapping("/bottom")
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
@@ -102,6 +102,13 @@
                    #{shopId}
                </foreach>
            </if>
            and ( ta.id
             in
            (
            <foreach collection="userIds" item="userId" open="(" separator="," close=")">
                #{userId}
            </foreach>
            ) or ta.shop_id = #{objectId} )
        </where>
    </select>
</mapper>