diff --git a/platformapi/yinbaoapi/yinbaoapi.go b/platformapi/yinbaoapi/yinbaoapi.go index f90ac0da..0d8d737c 100644 --- a/platformapi/yinbaoapi/yinbaoapi.go +++ b/platformapi/yinbaoapi/yinbaoapi.go @@ -167,27 +167,27 @@ func IsErrSkuExist(err error) (isExist bool) { //修改商品 //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{}{ - "uid": productInfoParam.ProductInfo.UID, + "uid": productInfo.UID, } - if productInfoParam.ProductInfo.BuyPrice != nil { - mapP["buyPrice"] = productInfoParam.ProductInfo.BuyPrice + if productInfo.BuyPrice != nil { + mapP["buyPrice"] = productInfo.BuyPrice } - if productInfoParam.ProductInfo.SellPrice != nil { - mapP["sellPrice"] = productInfoParam.ProductInfo.SellPrice + if productInfo.SellPrice != nil { + mapP["sellPrice"] = productInfo.SellPrice } - if productInfoParam.ProductInfo.Stock != nil { - mapP["stock"] = productInfoParam.ProductInfo.Stock + if productInfo.Stock != nil { + mapP["stock"] = productInfo.Stock } - if productInfoParam.ProductInfo.Enable != nil { - mapP["enable"] = productInfoParam.ProductInfo.Enable + if productInfo.Enable != nil { + mapP["enable"] = productInfo.Enable } - if productInfoParam.ProductInfo.IsCustomerDiscount != nil { - mapP["isCustomerDiscount"] = productInfoParam.ProductInfo.IsCustomerDiscount + if productInfo.IsCustomerDiscount != nil { + mapP["isCustomerDiscount"] = productInfo.IsCustomerDiscount } - if productInfoParam.ProductInfo.CustomerPrice != nil { - mapP["customerPrice"] = productInfoParam.ProductInfo.CustomerPrice + if productInfo.CustomerPrice != nil { + mapP["customerPrice"] = productInfo.CustomerPrice } a.AccessAPI("productOpenApi/updateProductInfo", map[string]interface{}{ "productInfo": mapP,