This commit is contained in:
苏尹岚
2021-03-02 09:24:40 +08:00
parent 603b27eb38
commit dd1e4d9c23

View File

@@ -156,7 +156,7 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
param = &jdapi.OpSkuParam{ param = &jdapi.OpSkuParam{
TraceID: ctx.GetTrackInfo(), TraceID: ctx.GetTrackInfo(),
OutSkuID: utils.Int2Str(sku.SkuID), OutSkuID: utils.Int2Str(sku.SkuID),
ShopCategories: []int64{utils.Str2Int64(sku.VendorCatID)}, ShopCategories: []int64{},
CategoryID: sku.VendorVendorCatID, CategoryID: sku.VendorVendorCatID,
BrandID: DefBrandID, BrandID: DefBrandID,
SkuName: utils.LimitUTF8StringLen(sku.SkuName, jdapi.MaxSkuNameCharCount), SkuName: utils.LimitUTF8StringLen(sku.SkuName, jdapi.MaxSkuNameCharCount),
@@ -168,6 +168,9 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
Upc: sku.Upc, Upc: sku.Upc,
// Images: jxutils.BatchString2Slice(sku.Img, sku.Img2), // Images: jxutils.BatchString2Slice(sku.Img, sku.Img2),
} }
if sku.VendorCatID != "" {
param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(sku.VendorCatID))
}
if sku.ImgMix != "" { if sku.ImgMix != "" {
param.Images = jxutils.BatchString2Slice(sku.ImgMix, sku.Img2, sku.Img3) param.Images = jxutils.BatchString2Slice(sku.ImgMix, sku.Img2, sku.Img3)
} else { } else {
@@ -201,7 +204,7 @@ func (p *PurchaseHandler) CreateSku2(ctx *jxcontext.Context, sku *dao.StoreSkuSy
OutSkuId: utils.Int2Str(sku.SkuID), OutSkuId: utils.Int2Str(sku.SkuID),
Upc: sku.Upc, Upc: sku.Upc,
JdPrice: utils.Int64ToStr(sku.Price), JdPrice: utils.Int64ToStr(sku.Price),
ShopCategoryID: utils.Str2Int64(sku.VendorCatID), ShopCategoryID: utils.Str2Int64WithDefault((sku.VendorCatID), 0),
}, },
}) })
if err2 == nil { if err2 == nil {