From c08a7d8a4f73a171983cbd1acdc5c8e3fe3d4902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 6 Feb 2023 17:29:34 +0800 Subject: [PATCH] 1 --- business/model/dao/thing_map.go | 6 +++--- business/partner/purchase/tiktok_store/store_sku2_utils.go | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/business/model/dao/thing_map.go b/business/model/dao/thing_map.go index cf99464ea..2eafc33c1 100644 --- a/business/model/dao/thing_map.go +++ b/business/model/dao/thing_map.go @@ -82,9 +82,9 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo } // DeleteThingToTiktokMapList 删除同步关联关系 -func DeleteThingToTiktokMapList(vendorId int, vendorThingId string) error { - sql := ` DELETE FROM thing_map t1 WHERE vendor_thing_id = ? AND vendor_id = ? ` - param := []interface{}{vendorThingId, vendorId} +func DeleteThingToTiktokMapList(vendorId int, vendorThingId string, skuId int) error { + sql := ` DELETE FROM thing_map t1 WHERE vendor_thing_id = ? AND vendor_id = ? AND thing_id = ? ` + param := []interface{}{vendorThingId, vendorId, skuId} _, err := ExecuteSQL(GetDB(), sql, param...) return err } diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index b31b31904..b35fd7207 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -209,6 +209,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI storeSku.VendorSonSkuID = utils.Int2Str(storeSku.SkuID) // 还没同步子商品 failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("只创建了主商品,没创建子商品"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType) } else if localThing[0].SyncStatus == model.ThingTypeSyncing { + if time.Now().Unix()-localThing[0].CreatedAt.Unix() > 300 { + dao.DeleteThingToTiktokMapList(model.VendorIDDD, localThing[0].VendorThingID, storeSku.SkuID) + } continue } else if localThing[0].SyncStatus == model.ThingTypeSyncSuccess { // 主商品存在,直接同步子商品