|
|
@@ -135,20 +135,8 @@ public class LifeCouponServiceImpl extends ServiceImpl<LifeCouponMapper, LifeCou
|
|
|
wrapper.like(name != null && !name.isEmpty(), LifeCoupon::getName, name);
|
|
|
wrapper.eq(LifeCoupon::getType, 1);
|
|
|
wrapper.eq(LifeCoupon::getDataType, dataType);
|
|
|
-// 修改排序代金券排序状态,按照状态和时间排序
|
|
|
-// wrapper.orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
wrapper.last("ORDER BY CASE WHEN status = 5 THEN 0 ELSE 1 END ASC , created_time DESC");
|
|
|
IPage<LifeCoupon> lifeCouponIPage = new Page<>(page, size);
|
|
|
- //如果singleQty 库存的数量<=0,则修改status状态为已售罄 状态为4
|
|
|
- LifeCoupon lifeCouponNew = new LifeCoupon();
|
|
|
- lifeCouponNew.setStoreId(storeId);
|
|
|
- lifeCouponNew.setStatus(4);
|
|
|
- lifeCouponMapper.update(lifeCouponNew, new LambdaUpdateWrapper<LifeCoupon>().eq(LifeCoupon::getSingleQty, 0));
|
|
|
- //如果当前时间小于开始时间,则修改status状态为未开始 状态为2
|
|
|
-// LifeCoupon lifeCouponNew1 = new LifeCoupon();
|
|
|
-// lifeCouponNew1.setStoreId(storeId);
|
|
|
-// lifeCouponNew1.setStatus(2);
|
|
|
-// lifeCouponMapper.update(lifeCouponNew1, new LambdaUpdateWrapper<LifeCoupon>().gt(LifeCoupon::getStartDate, LocalDateTime.now()));
|
|
|
return lifeCouponMapper.selectPage(lifeCouponIPage, wrapper);
|
|
|
}
|
|
|
|