feat: 为折扣计算函数 getDiscount 引入新用户判断逻辑以支持新用户专属折扣。
Build docker and publish / build (20.15.1) (push) Successful in 7m37s

This commit is contained in:
2026-03-11 03:56:48 -07:00
parent 6557d06d59
commit fafb229295
7 changed files with 15 additions and 7 deletions
@@ -73,7 +73,7 @@ func (l *PurchaseLogic) Purchase(req *types.PortalPurchaseRequest) (resp *types.
if sub.Discount != "" {
var dis []types.SubscribeDiscount
_ = json.Unmarshal([]byte(sub.Discount), &dis)
discount = getDiscount(dis, req.Quantity)
discount = getDiscount(dis, req.Quantity, true)
}
price := sub.UnitPrice * req.Quantity
// discount amount