Browse Source

修复

master v0.2.2
guzeng 3 years ago
parent
commit
a7ecf9670b
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      commission.go

+ 5
- 5
commission.go View File

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


Loading…
Cancel
Save