From 64ee09a3886c02c3e1d6711346b8b441b356246f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 9 Nov 2022 16:23:25 +0800 Subject: [PATCH] 1 --- .../purchase/tiktok_store/store_sku2_utils.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index f9bbacaa4..c54955662 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -126,7 +126,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI syncType = "创建商品" for _, storeSku := range storeSkuList { // 创建商品 param := &product_addV2_request.ProductAddV2Param{ - CategoryLeafId: utils.Str2Int64(storeSku.SkuVendorMapCatID), Name: utils.LimitUTF8StringLen(storeSku.SkuName, mtwmapi.MaxSkuNameCharCount), PayType: tiktokShop.TiktokPayType1, ReduceType: tiktokShop.SkuReduceTypePayMakeOrder, @@ -143,6 +142,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI PickupMethod: "0", OuterProductId: utils.Int2Str(storeSku.SkuID), // 本地skuId为外部商品id } + if storeSku.SkuVendorMapCatID != "" { + param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID) + } else { + param.CategoryLeafId = storeSku.VendorVendorCatID + } + // param.AccountTemplateId = "" // 获取上传图,商品轮播图 img, err := GetTiktokImgList(utils.Int2Str(storeSku.StoreID), storeDetail.VendorOrgCode, storeSku.ImgOrigin, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5) @@ -288,7 +293,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI for _, storeSku := range storeSkuList { // 更新商品(目前只更新子商品,主商品暂不支持) param := &product_editV2_request.ProductEditV2Param{ - CategoryLeafId: utils.Str2Int64(storeSku.SkuVendorMapCatID), Name: storeSku.Name, PayType: tiktokShop.TiktokPayType1, ReduceType: tiktokShop.SkuReduceTypePayMakeOrder, @@ -304,6 +308,11 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI StartSaleType: 0, PickupMethod: "0", } + if storeSku.SkuVendorMapCatID != "" { + param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID) + } else { + param.CategoryLeafId = storeSku.VendorVendorCatID + } // param.AccountTemplateId = "" // 获取上传图,商品轮播图 img, err := GetTiktokImgList(utils.Int2Str(storeSku.StoreID), storeDetail.VendorOrgCode, storeSku.ImgOrigin, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5)