饿百单个更新价格api只返回err
This commit is contained in:
@@ -446,38 +446,14 @@ func (a *API) SkuPriceUpdateBatch(trackInfo, shopID string, priceList ShopSkuInf
|
|||||||
return opResult, err
|
return opResult, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) SkuPriceUpdateOne(trackInfo, shopID string, priceInfo *ShopSkuInfo) (opResult *BatchOpResult, err error) {
|
func (a *API) SkuPriceUpdateOne(trackInfo, shopID string, priceInfo *ShopSkuInfo) (err error) {
|
||||||
skuIDType := priceInfo.GuessIDType()
|
skuIDType := priceInfo.GuessIDType()
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
KeyShopID: shopID,
|
KeyShopID: shopID,
|
||||||
priceUpdateKeyIDMap[skuIDType]: priceInfo.PriceString(skuIDType),
|
priceUpdateKeyIDMap[skuIDType]: priceInfo.PriceString(skuIDType),
|
||||||
}
|
}
|
||||||
result, err := a.AccessAPI2("sku.price.update.one", params, trackInfo)
|
_, err = a.AccessAPI2("sku.price.update.one", params, trackInfo)
|
||||||
resultMap := utils.Struct2MapByJson(result)
|
return err
|
||||||
if resultMap["errno"] == 0 {
|
|
||||||
var successList []*BatchOpSkuResult
|
|
||||||
success := &BatchOpSkuResult{
|
|
||||||
SkuID: priceInfo.SkuID,
|
|
||||||
ErrorMsg: resultMap["error"].(string),
|
|
||||||
ErrorNo: resultMap["errno"].(int),
|
|
||||||
}
|
|
||||||
successList = append(successList, success)
|
|
||||||
opResult = &BatchOpResult{
|
|
||||||
SuccessList: successList,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var failedList []*BatchOpSkuResult
|
|
||||||
failed := &BatchOpSkuResult{
|
|
||||||
SkuID: priceInfo.SkuID,
|
|
||||||
ErrorMsg: resultMap["error"].(string),
|
|
||||||
ErrorNo: resultMap["errno"].(int),
|
|
||||||
}
|
|
||||||
failedList = append(failedList, failed)
|
|
||||||
opResult = &BatchOpResult{
|
|
||||||
FailedList: failedList,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return opResult, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) SkuStockUpdateBatch(trackInfo, shopID string, stockList ShopSkuInfoList, skuIDType int) (opResult *BatchOpResult, err error) {
|
func (a *API) SkuStockUpdateBatch(trackInfo, shopID string, stockList ShopSkuInfoList, skuIDType int) (opResult *BatchOpResult, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user