Browse Source

fix:领取优惠券余量更新

ct 3 weeks ago
parent
commit
0dcb2e2792
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs-service/src/main/java/com/fs/his/mapper/FsCouponMapper.java

+ 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);
 }