Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松
2025-09-26 16:23:18 +08:00

View File

@@ -125,12 +125,16 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
} }
if (isNotNewUser && coupon.getGetLimit() != -10086) { if (isNotNewUser && coupon.getGetLimit() != -10086) {
if (coupon.getSyncId() != null) { if (coupon.getSyncId() != null) {
long count = recordService.count(new QueryWrapper().eq(MkShopCouponRecord::getCouponSyncId, coupon.getSyncId())); long count = recordService.count(new QueryWrapper()
.eq(MkShopCouponRecord::getUserId, userId)
.eq(MkShopCouponRecord::getCouponSyncId, coupon.getSyncId()));
if (count >= coupon.getGetLimit()) { if (count >= coupon.getGetLimit()) {
continue; continue;
} }
} else { } else {
long count = recordService.count(new QueryWrapper().eq(MkShopCouponRecord::getCouponId, coupon.getId())); long count = recordService.count(new QueryWrapper()
.eq(MkShopCouponRecord::getUserId, userId)
.eq(MkShopCouponRecord::getCouponId, coupon.getId()));
if (count >= coupon.getGetLimit()) { if (count >= coupon.getGetLimit()) {
continue; continue;
} }