Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop

This commit is contained in:
苏尹岚
2020-10-09 11:48:37 +08:00

View File

@@ -246,7 +246,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
syncType = "更新商品" syncType = "更新商品"
} }
for i, storeSku := range storeSkuList { for i, storeSku := range storeSkuList {
// isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0 isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&(model.SyncFlagPriceMask|model.SyncFlagNewMask) != 0
foodData := make(map[string]interface{}) foodData := make(map[string]interface{})
foodDataList[i] = foodData foodDataList[i] = foodData
foodData[mtwmapi.KeyAppFoodCode] = utils.Int2Str(storeSku.SkuID) foodData[mtwmapi.KeyAppFoodCode] = utils.Int2Str(storeSku.SkuID)
@@ -258,9 +258,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
foodData["skus"] = skus foodData["skus"] = skus
foodData["name"] = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount) foodData["name"] = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
foodData["description"] = storeSku.Comment foodData["description"] = storeSku.Comment
// if isNeedUpdatePrice { if isNeedUpdatePrice {
// foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice) foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice)
// } }
if storeSku.MinOrderCount != 0 { if storeSku.MinOrderCount != 0 {
foodData["min_order_count"] = storeSku.MinOrderCount foodData["min_order_count"] = storeSku.MinOrderCount
} else { } else {
@@ -301,9 +301,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
// foodData["tag_id"] = utils.Int64ToStr(defVendorCatID) // foodData["tag_id"] = utils.Int64ToStr(defVendorCatID)
} }
skus[0]["spec"] = jxutils.ComposeSkuSpec(storeSku.SpecQuality, storeSku.SpecUnit) skus[0]["spec"] = jxutils.ComposeSkuSpec(storeSku.SpecQuality, storeSku.SpecUnit)
// if isNeedUpdatePrice { if isNeedUpdatePrice {
// skus[0]["price"] = foodData["price"] skus[0]["price"] = foodData["price"]
// } }
skus[0]["stock"] = stockCount2Mtwm(model.MaxStoreSkuStockQty) skus[0]["stock"] = stockCount2Mtwm(model.MaxStoreSkuStockQty)
if storeSku.Upc != "" { if storeSku.Upc != "" {
skus[0]["upc"] = storeSku.Upc skus[0]["upc"] = storeSku.Upc