- set mtwm sku weight when tag_id specified in SyncStoreSkus
This commit is contained in:
@@ -261,16 +261,19 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
|
|||||||
} else {
|
} else {
|
||||||
// foodData["tag_id"] = utils.Int64ToStr(defVendorCatID)
|
// foodData["tag_id"] = utils.Int64ToStr(defVendorCatID)
|
||||||
}
|
}
|
||||||
foodData["skus"] = []map[string]interface{}{
|
skus := []map[string]interface{}{
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"sku_id": foodData[mtwmapi.KeyAppFoodCode],
|
"sku_id": foodData[mtwmapi.KeyAppFoodCode],
|
||||||
"spec": jxutils.ComposeSkuSpec(skuItem.SpecQuality, skuItem.SpecUnit),
|
"spec": jxutils.ComposeSkuSpec(skuItem.SpecQuality, skuItem.SpecUnit),
|
||||||
// "weight": skuItem.Weight, // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用
|
|
||||||
"price": foodData["price"],
|
"price": foodData["price"],
|
||||||
"stock": "*",
|
"stock": "*",
|
||||||
"upc": skuItem.Upc,
|
"upc": skuItem.Upc,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if foodData["tag_id"] != nil {
|
||||||
|
skus[0]["weight"] = skuItem.Weight // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用
|
||||||
|
}
|
||||||
|
foodData["skus"] = skus
|
||||||
if globals.EnableStoreWrite && globals.EnableMtwmStoreWrite {
|
if globals.EnableStoreWrite && globals.EnableMtwmStoreWrite {
|
||||||
err = api.MtwmAPI.RetailBatchInitData(vendorStoreID, foodDataList)
|
err = api.MtwmAPI.RetailBatchInitData(vendorStoreID, foodDataList)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user