From 787c559d46634764992f849c73b8c8038bbbfc89 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Mon, 7 Apr 2025 18:41:08 +0800 Subject: [PATCH] upate --- app/api/endpoints/coupon_activity.py | 4 +++- jobs.sqlite | Bin 24576 -> 24576 bytes 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/endpoints/coupon_activity.py b/app/api/endpoints/coupon_activity.py index 9ab5a81..c709408 100644 --- a/app/api/endpoints/coupon_activity.py +++ b/app/api/endpoints/coupon_activity.py @@ -171,7 +171,9 @@ async def check_activity_can_receive( CouponReceiveRecordDB.activity_id == activity_id ).scalar() - if activity.total_limit > 0 and total_receive_count >= activity.total_limit: + total = total_receive_count if total_receive_count else 0 + + if activity.total_limit > 0 and total >= activity.total_limit: return False, f"优惠券活动已领完", activity # 检查用户领取次数 diff --git a/jobs.sqlite b/jobs.sqlite index 707156c93cc9435199c9d30a904ec93bfe017227..2d927b674f610c1b9e9cd760218680a47c8aa2e8 100644 GIT binary patch delta 19 bcmZoTz}Rqrae_4C^NBLfjL$bFEQkjHP4Nf* delta 19 bcmZoTz}Rqrae_4C(}^<9j88WvEQkjHP16VZ