|
@@ -105,9 +105,18 @@ public class AddressLogic {
|
|
|
}
|
|
|
|
|
|
public IPage<UserAddress> page(String userId, Integer pageNum, Integer pageSize) {
|
|
|
- return userAddressService.lambdaQuery()
|
|
|
+
|
|
|
+ Integer count = userAddressService.lambdaQuery()
|
|
|
+ .eq(StringUtils.isNotBlank(userId), UserAddress::getUserId, userId)
|
|
|
+ .orderByDesc(UserAddress::getCreateTime).count();
|
|
|
+ if (count< 1)
|
|
|
+ return new Page<>();
|
|
|
+
|
|
|
+ Page<UserAddress> page = userAddressService.lambdaQuery()
|
|
|
.eq(StringUtils.isNotBlank(userId), UserAddress::getUserId, userId)
|
|
|
- .orderByDesc(UserAddress::getCreateTime).page(new Page(pageNum, pageSize));
|
|
|
+ .orderByDesc(UserAddress::getCreateTime)
|
|
|
+ .page(new Page<>(pageNum, pageSize));
|
|
|
+ return page;
|
|
|
|
|
|
}
|
|
|
|