| | |
| | | if (uid == null) { |
| | | return 0; |
| | | } |
| | | Long num = baseMapper.selectCount(new LambdaQueryWrapper<XpAppUserCoupon>().eq(XpAppUserCoupon::getAppUserId, Long.valueOf(uid)).eq(XpAppUserCoupon::getStatus, 1).lt(XpAppUserCoupon::getExpirationTime, LocalDateTime.now())); |
| | | Long num = baseMapper.selectCount(new LambdaQueryWrapper<XpAppUserCoupon>().eq(XpAppUserCoupon::getAppUserId, Long.valueOf(uid)) |
| | | .eq(XpAppUserCoupon::getStatus, 1).last(" and now() between effective_time and expiration_time")); |
| | | return num.intValue(); |
| | | } |
| | | |
| | |
| | | public UserCouponListVo getUserCouponList(BigDecimal orderMoney, String uid) { |
| | | List<CouponVo> usableCouponList = new ArrayList<>(); |
| | | List<CouponVo> notUsableCouponList = new ArrayList<>(); |
| | | List<XpAppUserCoupon> list = this.list(new QueryWrapper<XpAppUserCoupon>().eq("app_user_id", Long.valueOf(uid)).eq("status", 1).eq("is_deleted", 0)); |
| | | List<XpAppUserCoupon> list = this.list(new QueryWrapper<XpAppUserCoupon>().eq("app_user_id", Long.valueOf(uid)) |
| | | .eq("status", 1).eq("is_deleted", 0).last(" and now() between effective_time and expiration_time")); |
| | | for (XpAppUserCoupon xpAppUserCoupon : list) { |
| | | XpCoupon data = xpCouponClient.getCouponById(xpAppUserCoupon.getCouponId()).getData(); |
| | | if(null == data){ |