会员积分改版V7

This commit is contained in:
2026-08-11 13:23:22 +08:00
parent 809ff47120
commit a49ed802f4
14 changed files with 137 additions and 29 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ class CreditProduct(Base, TimestampMixin):
"AND first_purchase_price IS NOT NULL AND regular_price IS NOT NULL "
"AND grant_credits IS NULL AND validity_months IS NULL) "
"OR (product_type = 'credit_addon' AND grant_credits IS NOT NULL "
"AND validity_months = 1 AND tier_code IS NULL AND tier_rank IS NULL "
"AND validity_months BETWEEN 1 AND 36 AND tier_code IS NULL AND tier_rank IS NULL "
"AND billing_cycle IS NULL AND monthly_grant_credits IS NULL "
"AND first_purchase_price IS NULL AND regular_price IS NULL "
"AND activity_price IS NULL AND activity_start_at IS NULL AND activity_end_at IS NULL)",
@@ -63,7 +63,7 @@ class CreditProduct(Base, TimestampMixin):
Boolean, nullable=False, default=True, server_default="true"
)
# 积分增值包字段;当前固定一个自然月有效。
# 积分增值包字段;有效期按自然月配置,范围1-36个月
grant_credits: Mapped[Decimal | None] = mapped_column(Numeric(20, 2), nullable=True)
validity_months: Mapped[int | None] = mapped_column(nullable=True)