|
@@ -145,19 +145,7 @@ public class LifeCouponServiceImpl extends ServiceImpl<LifeCouponMapper, LifeCou
|
|
|
"WHEN status IN (4, 6, 7) THEN 3 " + // 已售罄、已下架、已结束
|
|
"WHEN status IN (4, 6, 7) THEN 3 " + // 已售罄、已下架、已结束
|
|
|
"ELSE 4 END ASC, " +
|
|
"ELSE 4 END ASC, " +
|
|
|
"created_time DESC");
|
|
"created_time DESC");
|
|
|
-
|
|
|
|
|
-// 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);
|
|
IPage<LifeCoupon> lifeCouponIPage = new Page<>(page, size);
|
|
|
- //如果singleQty 库存的数量<=0,则修改status状态为已售罄 状态为4
|
|
|
|
|
- LifeCoupon lifeCouponNew = new LifeCoupon();
|
|
|
|
|
- lifeCouponNew.setStatus(4);
|
|
|
|
|
- lifeCouponMapper.update(lifeCouponNew, new LambdaUpdateWrapper<LifeCoupon>().eq(LifeCoupon::getSingleQty, 0).eq(LifeCoupon::getStoreId, storeId));
|
|
|
|
|
- //如果当前时间小于开始时间,则修改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);
|
|
return lifeCouponMapper.selectPage(lifeCouponIPage, wrapper);
|
|
|
}
|
|
}
|
|
|
|
|
|