银豹修改商品接口修改
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user