- SkuCategory下添加调价比例:JdPricePercentage,EbaiPricePercentage,MtwmPricePercentage
This commit is contained in:
@@ -177,7 +177,14 @@ func GetSliceLen(list interface{}) int {
|
||||
return reflect.ValueOf(list).Len()
|
||||
}
|
||||
|
||||
func CaculateSkuVendorPrice(price int, percentage int) int {
|
||||
func CaculateSkuVendorPrice(price, percentage, catPercentage int) int {
|
||||
if percentage <= 10 || percentage >= 400 {
|
||||
percentage = 100
|
||||
}
|
||||
if catPercentage <= 10 || catPercentage >= 400 {
|
||||
catPercentage = 100
|
||||
}
|
||||
percentage = percentage * catPercentage / 100
|
||||
storePrice := int(math.Round(float64(price*percentage) / 100))
|
||||
if storePrice < 0 {
|
||||
storePrice = 0
|
||||
|
||||
Reference in New Issue
Block a user