商品支持有两张图片

This commit is contained in:
gazebo
2019-09-25 14:57:45 +08:00
parent 84740c33f0
commit 41866bf4b2
6 changed files with 69 additions and 31 deletions

View File

@@ -235,6 +235,18 @@ func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, storeID i
}
func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate bool) (params map[string]interface{}) {
photos := []map[string]interface{}{
map[string]interface{}{
"is_master": true,
"url": storeSku.Img,
},
}
if storeSku.Img2 != "" {
photos = append(photos, map[string]interface{}{
"is_master": false,
"url": storeSku.Img2,
})
}
params = map[string]interface{}{
"name": utils.LimitMixedStringLen(storeSku.SkuName, ebaiapi.MaxSkuNameByteCount),
"left_num": model.MaxStoreSkuStockQty,
@@ -244,12 +256,7 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate bool
// "cat2_id": getEbaiCat(storeSku.VendorVendorCatID2, 2),
"cat3_id": getEbaiCat(storeSku.VendorVendorCatID, 3),
"weight": storeSku.Weight,
"photos": []map[string]interface{}{
map[string]interface{}{
"is_master": true,
"url": storeSku.Img,
},
},
"photos": photos,
}
if storeSku.DescImg != "" {
params["rtf"] = storeSku.DescImg