This commit is contained in:
邹宗楠
2026-07-10 14:34:35 +08:00
parent 958f9ce14a
commit 0dc5510f0d

View File

@@ -132,14 +132,17 @@ func CopyEBaiToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail,
} }
} }
case 3: case 3:
i := 1
skuIdOffset := 0
for { for {
// 同步商品 i := 1
fromFoodList, err1 := api.SkuList(utils.Int2Str(fromStore.ID), &ebaiapi.SkuListParams{ skuIdOffset := 0
param := &ebaiapi.SkuListParams{
Page: i, Page: i,
SkuIdOffset: skuIdOffset, SkuIdOffset: skuIdOffset,
}) }
// 同步商品
fromFoodList, err1 := api.SkuList(utils.Int2Str(fromStore.ID), param)
if len(fromFoodList.List) == 0 || fromFoodList == nil || len(fromFoodList.List) < 100 { if len(fromFoodList.List) == 0 || fromFoodList == nil || len(fromFoodList.List) < 100 {
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i) return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
} }
@@ -183,7 +186,7 @@ func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, t
params["name"] = storeSku.Name params["name"] = storeSku.Name
params["cat3_id"] = storeSku.CateId params["cat3_id"] = storeSku.CateId
params["category_id"] = VendorCategoryIDMap[utils.Str2Int64(storeSku.CustomCatList[0].CustomCatID)] params["category_id"] = VendorCategoryIDMap[utils.Str2Int64(storeSku.CustomCatList[0].CustomCatID)]
params["rtf"] = storeSku.Rtf params["desc"] = storeSku.Desc
params["left_num"] = storeSku.LeftNum params["left_num"] = storeSku.LeftNum
params["process_type"] = storeSku.ProcessType params["process_type"] = storeSku.ProcessType
params["process_detail"] = storeSku.ProcessDetail params["process_detail"] = storeSku.ProcessDetail