From bb1eb616c21c24fa2a8c44fa93c8d59c4dfcc547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 4 Jan 2023 22:14:31 +0800 Subject: [PATCH] 1 --- .../purchase/tiktok_store/store_sku2_utils.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index b11944b75..db96a0ec9 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -28,7 +28,6 @@ import ( "git.rosy.net.cn/jx-callback/globals" "math/rand" "strings" - "time" "unicode" ) @@ -276,7 +275,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } else { // 主商品存在,直接同步子商品 childrenProductId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID)) - if strings.Contains(err.Error(), "2010004") { // 2010004:主商品非在线审核通过状态,不允许绑定子商品 + if err != nil && strings.Contains(err.Error(), "2010004") { // 2010004:主商品非在线审核通过状态,不允许绑定子商品 // 线上本地都存在,但是线上审核不成功,就去更新主商品 mainOrderDetail = loadMainProductId(api, storeSku) if mainOrderDetail.CheckStatus == tiktokShop.SkuCheckStatusProhibit || mainOrderDetail.CheckStatus == tiktokShop.SkuCheckStatusNotPass { @@ -310,12 +309,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI if err := api.EditStoreCommodity(updateParam); err != nil { failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType) storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID) - } else { - localThing[0].UpdatedAt = time.Now() - localThing[0].SyncStatus = 0 - localThing[0].ThingType = model.ThingTypeSku - dao.UpdateThingMap(localThing[0]) - } + } //else { + // localThing[0].UpdatedAt = time.Now() + // localThing[0].SyncStatus = 0 + // localThing[0].ThingType = model.ThingTypeSku + // dao.UpdateThingMap(localThing[0]) + //} continue } }