From ef90a430ac5ea93aa4baf1b22aeefde35152023c Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 17 Oct 2019 16:49:37 +0800 Subject: [PATCH] =?UTF-8?q?category=5Fname=5Forigin=E6=9C=89=E5=80=BC?= =?UTF-8?q?=E6=89=8D=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/mtwmapi/retail.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index 54943172..f721ce23 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -26,6 +26,7 @@ var ( type RetailCategoryInfo struct { Name string `json:"name"` + Code string `json:"code"` Sequence int `json:"sequence"` Level int `json:"level"` Children []*RetailCategoryInfo `json:"children"` @@ -160,7 +161,7 @@ func (a *API) RetailCatUpdate2(poiCode, originCode, originName, code, name, seco if originCode != "" { params["category_code_origin"] = originCode - } else { + } else if originName != "" { params["category_name_origin"] = originName } @@ -411,6 +412,7 @@ func interface2Cat(data interface{}, level int) (cat *RetailCategoryInfo) { if ok { cat = &RetailCategoryInfo{ Name: utils.Interface2String(mapData["name"]), + Code: utils.Interface2String(mapData["code"]), Sequence: int(utils.Interface2Int64WithDefault(mapData["sequence"], 0)), Level: level, }