This commit is contained in:
邹宗楠
2024-11-26 16:34:50 +08:00
parent a52f9a1ea1
commit ca0a6ca294

View File

@@ -431,7 +431,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
if isNeedUpdatePrice { if isNeedUpdatePrice {
skus[0]["price"] = foodData["price"] skus[0]["price"] = foodData["price"]
} }
skus[0]["stock"] = stockCount2Mtwm(model.MaxStoreSkuStockQty) skus[0]["stock"] = stockCount2Mtwm(storeSku.Stock)
if storeSku.Upc != "" { if storeSku.Upc != "" {
skus[0]["upc"] = storeSku.Upc skus[0]["upc"] = storeSku.Upc
} }
@@ -606,6 +606,9 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
} }
func stockCount2Mtwm(stock int) (mtwmStock string) { func stockCount2Mtwm(stock int) (mtwmStock string) {
if stock == 0 {
stock = model.MaxStoreSkuStockQty
}
return utils.Int2Str(stock) return utils.Int2Str(stock)
} }