diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java index e602b777..a4818d52 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java @@ -72,9 +72,12 @@ public class TbShopUserServiceImpl implements TbShopUserService { shopUserInfoVo.setTelephone(tbShopUser.getTelephone()); shopUserInfoVo.setTotalScore(0); }); + + if (shopUserInfoVo.getUserId() == null) { + shopUserInfoVo.setUserId(0); + } } - Integer orderNumber=tbOrderInfoRepository.countByUserIdAndStatusAndShopId( - shopUserInfoVo.getUserId() == null ? "0" : shopUserInfoVo.getUserId().toString(),criteria.getShopId()); + Integer orderNumber=tbOrderInfoRepository.countByUserIdAndStatusAndShopId(shopUserInfoVo.getUserId().toString(),criteria.getShopId()); shopUserInfoVo.setOrderNumber(Objects.isNull(orderNumber)?0:orderNumber); shopUserInfoVo.setInMoney(tbShopUserRepository.sumAmount(shopUserInfoVo.getId()));