feat(listing): 极品专区发布时增加比例加价
This commit is contained in:
@@ -252,6 +252,19 @@ func normalizePublishOptions(options *PublishOptionsDTO) {
|
||||
if len(options.RatioConfig.CoinCorrections) == 0 {
|
||||
options.RatioConfig.CoinCorrections = defaults.RatioConfig.CoinCorrections
|
||||
}
|
||||
options.RatioConfig.PremiumReviewRatioMarkup = normalizePremiumReviewRatioMarkup(
|
||||
options.RatioConfig.PremiumReviewRatioMarkup,
|
||||
)
|
||||
}
|
||||
|
||||
func normalizePremiumReviewRatioMarkup(value float64) float64 {
|
||||
if value < 0 || math.IsNaN(value) || math.IsInf(value, 0) {
|
||||
return 0
|
||||
}
|
||||
if value > 10 {
|
||||
return 10
|
||||
}
|
||||
return math.Round(value*10) / 10
|
||||
}
|
||||
|
||||
func normalizeSalePriceConfig(config *PublishSalePriceConfig) {
|
||||
|
||||
Reference in New Issue
Block a user