This commit is contained in:
邹宗楠
2023-01-04 22:14:31 +08:00
parent 239965819a
commit bb1eb616c2

View File

@@ -28,7 +28,6 @@ import (
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"math/rand" "math/rand"
"strings" "strings"
"time"
"unicode" "unicode"
) )
@@ -276,7 +275,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
} else { } else {
// 主商品存在,直接同步子商品 // 主商品存在,直接同步子商品
childrenProductId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID)) 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) mainOrderDetail = loadMainProductId(api, storeSku)
if mainOrderDetail.CheckStatus == tiktokShop.SkuCheckStatusProhibit || mainOrderDetail.CheckStatus == tiktokShop.SkuCheckStatusNotPass { 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 { if err := api.EditStoreCommodity(updateParam); err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType) failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID) storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
} else { } //else {
localThing[0].UpdatedAt = time.Now() // localThing[0].UpdatedAt = time.Now()
localThing[0].SyncStatus = 0 // localThing[0].SyncStatus = 0
localThing[0].ThingType = model.ThingTypeSku // localThing[0].ThingType = model.ThingTypeSku
dao.UpdateThingMap(localThing[0]) // dao.UpdateThingMap(localThing[0])
} //}
continue continue
} }
} }