From 6244dbec2fc5f68ef3db7d0a3d29925b70b52f7c Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 28 Sep 2018 12:15:22 +0800 Subject: [PATCH 1/2] - change elm order vendorSkuID from vfoodId to id --- business/partner/purchase/elm/order.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/business/partner/purchase/elm/order.go b/business/partner/purchase/elm/order.go index 807a19512..3b896c9ec 100644 --- a/business/partner/purchase/elm/order.go +++ b/business/partner/purchase/elm/order.go @@ -171,10 +171,11 @@ func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err VendorID: model.VendorIDELM, Count: int(utils.MustInterface2Int64(product["quantity"])), SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["extendCode"]), 0)), - VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["vfoodId"])), - SkuName: product["name"].(string), - SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])), - Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))), + //VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["vfoodId"])), + VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["id"])), // 2018-09-28日,饿了么迁移到饿百后,这个字段发生了变化 + SkuName: product["name"].(string), + SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])), + Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))), } order.Skus = append(order.Skus, sku) order.SkuCount++ From d1c91c83ceddbafa8d33015e826959fefdacc034 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 28 Sep 2018 12:25:24 +0800 Subject: [PATCH 2/2] - vfoodId --- business/partner/purchase/elm/order.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/business/partner/purchase/elm/order.go b/business/partner/purchase/elm/order.go index 3b896c9ec..979edaa60 100644 --- a/business/partner/purchase/elm/order.go +++ b/business/partner/purchase/elm/order.go @@ -171,11 +171,13 @@ func (c *PurchaseHandler) GetOrder(orderID string) (order *model.GoodsOrder, err VendorID: model.VendorIDELM, Count: int(utils.MustInterface2Int64(product["quantity"])), SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["extendCode"]), 0)), - //VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["vfoodId"])), - VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["id"])), // 2018-09-28日,饿了么迁移到饿百后,这个字段发生了变化 - SkuName: product["name"].(string), - SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])), - Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))), + VendorSkuID: utils.Int64ToStr(utils.Interface2Int64WithDefault(product["vfoodId"], 0)), + SkuName: product["name"].(string), + SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])), + Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))), + } + if sku.VendorSkuID == "0" { + sku.VendorSkuID = utils.Int64ToStr(utils.MustInterface2Int64(product["id"])) // 2018-09-28日,饿了么迁移到饿百后,这个字段发生了变化 } order.Skus = append(order.Skus, sku) order.SkuCount++