Bläddra i källkod

bugfix:代金券数量为0,状态不改变。

lyx 1 månad sedan
förälder
incheckning
d93bfb32a7
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      alien-entity/src/main/java/shop/alien/mapper/LifeCouponMapper.java

+ 2 - 2
alien-entity/src/main/java/shop/alien/mapper/LifeCouponMapper.java

@@ -68,10 +68,10 @@ public interface LifeCouponMapper extends BaseMapper<LifeCoupon> {
 
     @Update(" UPDATE life_coupon\n" +
             "    SET \n" +
-            "        single_qty = single_qty - #{buyCount},\n" +
             "        status = CASE WHEN (single_qty - #{buyCount}) = 0 \n" +
             "                     THEN #{soldOutStatus} \n" +
-            "                     ELSE status END\n" +
+            "                     ELSE status END,\n" +
+            "        single_qty = single_qty - #{buyCount}\n" +
             "    WHERE \n" +
             "        id = #{couponId} \n" +
             "        AND single_qty >= #{buyCount}")