- make params shopCategoryLevel, sor and username optional for jd.AddShopCategory

This commit is contained in:
gazebo
2019-03-19 22:52:51 +08:00
parent 9a1e89ab7c
commit 2293cae175

View File

@@ -206,9 +206,15 @@ func (a *API) AddShopCategory(pid int64, shopCategoryName string, shopCategoryLe
params := map[string]interface{}{
KeyPID: pid,
KeyShopCategoryName: shopCategoryName,
KeyShopCategoryLevel: shopCategoryLevel,
KeySort: sort,
"createPin": utils.GetAPIOperator(userName),
}
if shopCategoryLevel > 0 {
params[KeyShopCategoryLevel] = shopCategoryLevel
}
if sort >= 0 {
params[KeySort] = sort
}
if userName != "" {
params["createPin"] = utils.GetAPIOperator(userName)
}
result, err := a.AccessAPINoPage("pms/addShopCategory", params, nil, nil, nil)
if err == nil {