From a7ecf9670b8713c29b0514039c27506461deb13e Mon Sep 17 00:00:00 2001 From: guzeng Date: Tue, 9 Feb 2021 15:24:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commission.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commission.go b/commission.go index 0a5a180..02ba665 100644 --- a/commission.go +++ b/commission.go @@ -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 //没有特殊价格,返回原价