From 1a647ea5f2fb7f673077b45449d84776b49a18af Mon Sep 17 00:00:00 2001 From: lyb Date: Fri, 10 Aug 2018 17:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/controller/elm/order.go | 2 +- business/controller/elm/order_test.go | 2 +- business/model/const.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/business/controller/elm/order.go b/business/controller/elm/order.go index 44a5efb4d..aef73b72d 100644 --- a/business/controller/elm/order.go +++ b/business/controller/elm/order.go @@ -203,7 +203,7 @@ func setOrederDetailFee(result map[string]interface{}, order *model.GoodsOrder) categoryId := utils.MustInterface2Int64(activity["categoryId"]) restaurantPart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"])) elemePart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"])) - if _, isHave := model.ElmSkuPromotion[int(categoryId)]; isHave { + if _, ok := model.ElmSkuPromotion[int(categoryId)]; ok { order.SkuPmFee += restaurantPart order.SkuPmSubsidy += elemePart } else { diff --git a/business/controller/elm/order_test.go b/business/controller/elm/order_test.go index d0a3f8faf..2968fa458 100644 --- a/business/controller/elm/order_test.go +++ b/business/controller/elm/order_test.go @@ -20,7 +20,7 @@ func init() { api.Init() } -func Test_GetOrder(t *testing.T) { +func TestGetOrder(t *testing.T) { orderID := "3025427524410871880" order, err := new(OrderController).GetOrder(orderID) if err != nil { diff --git a/business/model/const.go b/business/model/const.go index 69097d23e..cdd7b9599 100644 --- a/business/model/const.go +++ b/business/model/const.go @@ -125,9 +125,9 @@ const ( ) var ( - ElmSkuPromotion = map[int]string{ - 11: "1", - 200: "1", + ElmSkuPromotion = map[int]int{ + 11: 1, + 200: 1, } )