- up
This commit is contained in:
@@ -146,6 +146,21 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, storeID i
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*partner.BareStoreSkuInfo) (err error) {
|
||||
skuStockList := make([]string, len(storeSkuList))
|
||||
for k, v := range storeSkuList {
|
||||
skuStockList[k] = fmt.Sprintf("%s:%d", v.VendorSkuID, v.Stock)
|
||||
}
|
||||
if globals.EnableEbaiStoreWrite {
|
||||
if len(skuStockList) > 1 {
|
||||
err = api.EbaiAPI.SkuStockUpdateBatch(utils.Int2Str(storeID), strings.Join(skuStockList, ";"), "", "")
|
||||
} else if len(skuStockList) == 1 {
|
||||
err = api.EbaiAPI.SkuStockUpdateOne(utils.Int2Str(storeID), skuStockList[0], "", "")
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo) (params map[string]interface{}) {
|
||||
params = map[string]interface{}{
|
||||
"name": storeSku.Name,
|
||||
|
||||
Reference in New Issue
Block a user