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

This commit is contained in:
张松 2025-09-26 16:23:18 +08:00
commit 7ceb16478a
1 changed files with 6 additions and 2 deletions

View File

@ -125,12 +125,16 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
}
if (isNotNewUser && coupon.getGetLimit() != -10086) {
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()) {
continue;
}
} 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()) {
continue;
}