This commit is contained in:
邹宗楠
2023-02-06 17:29:34 +08:00
parent b4b983d957
commit c08a7d8a4f
2 changed files with 6 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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 {
// 主商品存在,直接同步子商品