1
This commit is contained in:
@@ -165,8 +165,8 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
param.Description = detailImg
|
param.Description = detailImg
|
||||||
|
|
||||||
// 部分商品没有所属的分类,直接跳过!
|
// 部分商品没有所属的分类,直接跳过!
|
||||||
if storeSku.VendorVendorCatID != 0 {
|
if storeSku.SkuVendorMapCatID != "" {
|
||||||
param.CategoryLeafId = storeSku.VendorVendorCatID
|
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
||||||
} else if len(param.Pic) != 0 { // 自动推导分类id
|
} else if len(param.Pic) != 0 { // 自动推导分类id
|
||||||
param.CategoryLeafId, err = api.GetRecommendCategory(strings.Split(img, "|"))
|
param.CategoryLeafId, err = api.GetRecommendCategory(strings.Split(img, "|"))
|
||||||
if param.CategoryLeafId == 0 || err != nil {
|
if param.CategoryLeafId == 0 || err != nil {
|
||||||
@@ -302,17 +302,11 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
updateParam.ProductId = mainOrderDetail.ProductId
|
updateParam.ProductId = mainOrderDetail.ProductId
|
||||||
updateParam.MainProductId = mainProductId
|
updateParam.MainProductId = mainProductId
|
||||||
updateParam.SpecPrices = param.SpecPrices
|
updateParam.SpecPrices = param.SpecPrices
|
||||||
//updateParam.StoreId = utils.Str2Int64(vendorStoreID)
|
if err := api.EditStoreCommodity(updateParam); err != nil {
|
||||||
err := api.EditStoreCommodity(updateParam)
|
failedList = putils.GetErrMsg2FailedSingleList(storeSku, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||||
if err != nil {
|
|
||||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
|
||||||
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
||||||
} //else {
|
}
|
||||||
// localThing[0].UpdatedAt = time.Now()
|
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("修改子品,没创建子商品"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||||
// localThing[0].SyncStatus = 0
|
|
||||||
// localThing[0].ThingType = model.ThingTypeSku
|
|
||||||
// dao.UpdateThingMap(localThing[0])
|
|
||||||
//}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,11 +351,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
StartSaleType: 0,
|
StartSaleType: 0,
|
||||||
PickupMethod: "0",
|
PickupMethod: "0",
|
||||||
}
|
}
|
||||||
if storeSku.SkuVendorMapCatID != "" {
|
|
||||||
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
|
||||||
} else {
|
|
||||||
param.CategoryLeafId = storeSku.VendorVendorCatID
|
|
||||||
}
|
|
||||||
param.Name = checkNameLenght(param.Name)
|
param.Name = checkNameLenght(param.Name)
|
||||||
|
|
||||||
// 获取上传图,商品轮播图
|
// 获取上传图,商品轮播图
|
||||||
@@ -374,6 +363,16 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
param.Description = detailImg
|
param.Description = detailImg
|
||||||
param.WeightUnit = tiktokShop.WeightUint_G
|
param.WeightUnit = tiktokShop.WeightUint_G
|
||||||
|
|
||||||
|
// 部分商品没有所属的分类,直接跳过!
|
||||||
|
if storeSku.SkuVendorMapCatID != "" {
|
||||||
|
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
||||||
|
} else if len(param.Pic) != 0 { // 自动推导分类id
|
||||||
|
param.CategoryLeafId, err = api.GetRecommendCategory(strings.Split(img, "|"))
|
||||||
|
if param.CategoryLeafId == 0 || err != nil {
|
||||||
|
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误:"+err.Error()), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
// 获取商品的属性
|
// 获取商品的属性
|
||||||
if storeSku.TiktokAttribute == "" || storeSku.TiktokAttribute == "{}" {
|
if storeSku.TiktokAttribute == "" || storeSku.TiktokAttribute == "{}" {
|
||||||
param.ProductFormatNew, err = MakeProductFormatNew(api, int64(storeSku.NameID), param.CategoryLeafId)
|
param.ProductFormatNew, err = MakeProductFormatNew(api, int64(storeSku.NameID), param.CategoryLeafId)
|
||||||
|
|||||||
Reference in New Issue
Block a user