Parcourir la source

fix:领取优惠券余量更新

ct il y a 3 semaines
Parent
commit
0dcb2e2792

+ 1 - 1
fs-service/src/main/java/com/fs/his/mapper/FsCouponMapper.java

@@ -96,6 +96,6 @@ public interface FsCouponMapper
             " order by c.coupon_id desc "+
             "</script>"})
     List<FsCouponListUVO> selectFsCouponListUVO(@Param("maps")FsCouponListUParam param);
-    @Update("update fs_coupon set remain_number=(select ifnull(count(1),0) from fs_user_coupon uc where uc.coupon_id=#{couponId}) where coupon_id=#{couponId}")
+    @Update("update fs_coupon set remain_number=number-(select ifnull(count(1),0) from fs_user_coupon uc where uc.coupon_id=#{couponId}) where coupon_id=#{couponId}")
     int updateRemainCount(Long couponId);
 }