店铺用户不存在

This commit is contained in:
2026-05-27 16:35:31 +08:00
parent 6a94645076
commit 94fce3b08f

View File

@@ -193,7 +193,15 @@ public class AShopUserServiceImpl implements AShopUserService {
@Override
public ShopUser getDetail(Integer id, Integer userId) {
Long mainId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainId).eq(ShopUser::getId, id).eq(ShopUser::getUserId, userId));
ShopUser shopUser;
if (id == null) {
shopUser = shopUserService.getShopUserInfo(StpKit.USER.getShopId(), userId);
} else {
shopUser = shopUserService.getById(id);
if (shopUser == null) {
throw new CzgException("用户不存在");
}
}
long count = couponRecordService.count(new QueryWrapper()
.eq(MkShopCouponRecord::getShopUserId, shopUser.getId())
.eq(MkShopCouponRecord::getStatus, 0)