fix(order) discount set default 1
This commit is contained in:
parent
f6ce7b2cd3
commit
1b78e04113
@ -52,6 +52,9 @@ func (l *PreCreateOrderLogic) PreCreateOrder(req *types.PurchaseOrderRequest) (r
|
||||
discount = getDiscount(dis, req.Quantity)
|
||||
}
|
||||
price := sub.UnitPrice * req.Quantity
|
||||
if discount == 0 {
|
||||
discount = 1
|
||||
}
|
||||
amount := int64(float64(price) * discount)
|
||||
discountAmount := price - amount
|
||||
var couponAmount int64
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user