| | |
| | | package com.supersavedriving.user.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.user.modular.system.dao.UserToCouponMapper; |
| | | import com.supersavedriving.user.modular.system.model.Coupon; |
| | |
| | | public Integer queryUsedCouponNum(Integer uid) { |
| | | return this.baseMapper.queryUsedCouponNum(uid); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除优惠券 |
| | | */ |
| | | @Override |
| | | public void delUserCoupon() { |
| | | List<UserToCoupon> userToCoupons = this.selectList(new EntityWrapper<UserToCoupon>().eq("status", 1).last(" and UNIX_TIMESTAMP(expireTime) + 1296000 <= UNIX_TIMESTAMP(now())")); |
| | | for (UserToCoupon userToCoupon : userToCoupons) { |
| | | userToCoupon.setStatus(3); |
| | | this.updateById(userToCoupon); |
| | | } |
| | | } |
| | | } |