category_name_origin有值才设置

This commit is contained in:
gazebo
2019-10-17 16:49:37 +08:00
parent edfbf7565a
commit ef90a430ac

View File

@@ -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,
}