|
|
@@ -137,9 +137,17 @@ 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);
|
|
|
-// 修改排序代金券排序状态,按照状态和时间排序
|
|
|
+// 修改排序 按照status(0草稿/1待审核/2未开始/3审核拒绝/4已售罄/5进行中/6已下架/7已结束/8=2+手动下架) 审核拒绝>待审核>进行中>已售罄,已下架,已结束(同等优先级的情况下,按照审核时间的倒序显示)
|
|
|
+ wrapper.last("ORDER BY CASE " +
|
|
|
+ "WHEN status = 3 THEN 0 " + // 审核拒绝
|
|
|
+ "WHEN status = 1 THEN 1 " + // 待审核
|
|
|
+ "WHEN status = 5 THEN 2 " + // 进行中
|
|
|
+ "WHEN status IN (4, 6, 7) THEN 3 " + // 已售罄、已下架、已结束
|
|
|
+ "ELSE 4 END ASC, " +
|
|
|
+ "created_time DESC");
|
|
|
+
|
|
|
// wrapper.orderByDesc(LifeCoupon::getCreatedTime);
|
|
|
- wrapper.last("ORDER BY CASE WHEN status = 5 THEN 0 ELSE 1 END ASC , created_time DESC");
|
|
|
+// 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();
|