From 4943b583f9160b4d7b5e7bec8c1c122fdbc97f57 Mon Sep 17 00:00:00 2001 From: guzeng Date: Tue, 9 Feb 2021 15:20:14 +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 | 11 ++++++----- go.mod | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 go.mod diff --git a/commission.go b/commission.go index 4681e79..0a5a180 100644 --- a/commission.go +++ b/commission.go @@ -6,8 +6,9 @@ package ordercalc import ( "errors" - "strings" + + "git.tetele.net/tgo/helper" ) /** @@ -22,7 +23,7 @@ import ( */ func DistributionPrice(business map[string]string, productSpecialPrice []map[string]string, distributionPrice interface{}, percentAge interface{}, productPrice interface{}) (float64, error) { - product_price := ToString(productPrice) + product_price := helper.ToString(productPrice) if len(business) < 1 { return 0, errors.New("参数错误") @@ -34,13 +35,13 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str return 0, errors.New("分销商参数错误") } - distribution_price := ToString(distributionPrice) + distribution_price := helper.ToString(distributionPrice) distribution_price_float, err := ToFloat64(distributionPrice) if err != nil { return 0, err } - percent_age := ToString(percentAge) + percent_age := helper.ToString(percentAge) if len(productSpecialPrice) < 1 && percent_age == "" { return distribution_price_float, nil //没有特殊价格,没有分销比例,返回原分销价 @@ -179,7 +180,7 @@ func DistributionPrice(business map[string]string, productSpecialPrice []map[str */ func VipPrice(productSpecialPrice []map[string]string, productPrice interface{}) (float64, error) { - product_price := ToString(productPrice) + product_price := helper.ToString(productPrice) product_price_float, _ := ToFloat64(productPrice) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..08eb75c --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.tetele.net/tgo/ordercalc + +go 1.14