银豹修改商品接口修改

This commit is contained in:
苏尹岚
2020-03-23 17:55:52 +08:00
parent 11b1e7faa7
commit 37c792a067

View File

@@ -167,27 +167,27 @@ func IsErrSkuExist(err error) (isExist bool) {
//修改商品 //修改商品
//http://pospal.cn/openplatform/productapi.html#addProductInfo //http://pospal.cn/openplatform/productapi.html#addProductInfo
func (a *API) UpdateProductInfo(productInfoParam *ProductInfoParam) (err error) { func (a *API) UpdateProductInfo(productInfo *ProductInfo) (err error) {
mapP := map[string]interface{}{ mapP := map[string]interface{}{
"uid": productInfoParam.ProductInfo.UID, "uid": productInfo.UID,
} }
if productInfoParam.ProductInfo.BuyPrice != nil { if productInfo.BuyPrice != nil {
mapP["buyPrice"] = productInfoParam.ProductInfo.BuyPrice mapP["buyPrice"] = productInfo.BuyPrice
} }
if productInfoParam.ProductInfo.SellPrice != nil { if productInfo.SellPrice != nil {
mapP["sellPrice"] = productInfoParam.ProductInfo.SellPrice mapP["sellPrice"] = productInfo.SellPrice
} }
if productInfoParam.ProductInfo.Stock != nil { if productInfo.Stock != nil {
mapP["stock"] = productInfoParam.ProductInfo.Stock mapP["stock"] = productInfo.Stock
} }
if productInfoParam.ProductInfo.Enable != nil { if productInfo.Enable != nil {
mapP["enable"] = productInfoParam.ProductInfo.Enable mapP["enable"] = productInfo.Enable
} }
if productInfoParam.ProductInfo.IsCustomerDiscount != nil { if productInfo.IsCustomerDiscount != nil {
mapP["isCustomerDiscount"] = productInfoParam.ProductInfo.IsCustomerDiscount mapP["isCustomerDiscount"] = productInfo.IsCustomerDiscount
} }
if productInfoParam.ProductInfo.CustomerPrice != nil { if productInfo.CustomerPrice != nil {
mapP["customerPrice"] = productInfoParam.ProductInfo.CustomerPrice mapP["customerPrice"] = productInfo.CustomerPrice
} }
a.AccessAPI("productOpenApi/updateProductInfo", map[string]interface{}{ a.AccessAPI("productOpenApi/updateProductInfo", map[string]interface{}{
"productInfo": mapP, "productInfo": mapP,