|
|
@ -36,7 +36,7 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str |
|
|
|
} |
|
|
|
|
|
|
|
distribution_price := helper.ToString(distributionPrice) |
|
|
|
distribution_price_float, err := ToFloat64(distributionPrice) |
|
|
|
distribution_price_float, err := helper.ToFloat64(distributionPrice) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
@ -98,7 +98,7 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str |
|
|
|
default: |
|
|
|
//使用固定价格或者使用基础分销价
|
|
|
|
if formula != "" { |
|
|
|
result, _ = ToFloat64(formula) |
|
|
|
result, _ = helper.ToFloat64(formula) |
|
|
|
} else { |
|
|
|
result = distribution_price_float |
|
|
|
} |
|
|
@ -112,7 +112,7 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str |
|
|
|
totalCommission := FloatSub(productPrice, distributionPrice) //总佣金
|
|
|
|
|
|
|
|
if totalCommission <= 0 { |
|
|
|
return ToFloat64(productPrice) //总佣金为负,返回商品原价
|
|
|
|
return helper.ToFloat64(productPrice) //总佣金为负,返回商品原价
|
|
|
|
} |
|
|
|
|
|
|
|
if _, ok = business["Grade"]; ok { |
|
|
@ -166,7 +166,7 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str |
|
|
|
} |
|
|
|
|
|
|
|
if result < 0 { |
|
|
|
result, _ = ToFloat64(productPrice) |
|
|
|
result, _ = helper.ToFloat64(productPrice) |
|
|
|
} |
|
|
|
return result, nil |
|
|
|
} |
|
|
@ -182,7 +182,7 @@ func VipPrice(productSpecialPrice []map[string]string, productPrice interface{}) |
|
|
|
|
|
|
|
product_price := helper.ToString(productPrice) |
|
|
|
|
|
|
|
product_price_float, _ := ToFloat64(productPrice) |
|
|
|
product_price_float, _ := helper.ToFloat64(productPrice) |
|
|
|
|
|
|
|
if len(productSpecialPrice) < 1 { |
|
|
|
return product_price_float, nil //没有特殊价格,返回原价
|
|
|
|