From 40cfe46ba84912288202f08db0f4518158887fc7 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Tue, 31 Mar 2026 06:56:35 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20CountScopedSubscribePurchaseOrders=20?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E7=BB=AD=E8=B4=B9=E5=8D=95=E5=B9=B6=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=B5=A0=E9=80=81=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - type IN (1, 2):同时统计首购和续费历史,防止用户用续费绕过新人价限制 - amount > 0:排除 admin 赠送的免费订单(amount=0),避免误判新人资格 Co-Authored-By: claude-flow --- internal/logic/common/newUserEligibility.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/logic/common/newUserEligibility.go b/internal/logic/common/newUserEligibility.go index bb371d4..73a8cd7 100644 --- a/internal/logic/common/newUserEligibility.go +++ b/internal/logic/common/newUserEligibility.go @@ -76,7 +76,7 @@ func CountScopedSubscribePurchaseOrders( var count int64 query := db.WithContext(ctx). Model(&modelOrder.Order{}). - Where("user_id IN ? AND subscribe_id = ? AND type = 1", scopeUserIDs, subscribeID) + Where("user_id IN ? AND subscribe_id = ? AND type IN ? AND amount > 0", scopeUserIDs, subscribeID, []int64{1, 2}) if len(statuses) > 0 { query = query.Where("status IN ?", statuses) }