You've already forked FrameTour-BE
feat(pricing): 添加优惠券用户领取数量限制功能
- 新增用户领取数量限制字段 userClaimLimit - 区分已领取数量 claimedQuantity 和已使用数量 usedQuantity - 添加用户领取次数统计方法 countUserCouponClaims - 实现领取上限检查逻辑和错误码 CLAIM_LIMIT_REACHED - 更新数据库表结构和索引优化建议 - 完善文档说明和版本更新记录
This commit is contained in:
@@ -33,9 +33,16 @@ public interface PriceCouponClaimRecordMapper extends BaseMapper<PriceCouponClai
|
||||
*/
|
||||
@Select("SELECT * FROM price_coupon_claim_record " +
|
||||
"WHERE user_id = #{userId} AND coupon_id = #{couponId}")
|
||||
PriceCouponClaimRecord selectUserCouponRecord(@Param("userId") Long userId,
|
||||
PriceCouponClaimRecord selectUserCouponRecord(@Param("userId") Long userId,
|
||||
@Param("couponId") Long couponId);
|
||||
|
||||
|
||||
/**
|
||||
* 统计用户领取某优惠券的次数(所有状态)
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM price_coupon_claim_record " +
|
||||
"WHERE user_id = #{userId} AND coupon_id = #{couponId} AND deleted = 0")
|
||||
int countUserCouponClaims(@Param("userId") Long userId, @Param("couponId") Long couponId);
|
||||
|
||||
/**
|
||||
* 更新优惠券使用状态
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user