This commit is contained in:
邹宗楠
2023-09-22 10:33:16 +08:00
parent 02f33bf80f
commit ecbce245d1

View File

@@ -53,15 +53,16 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
fromCategoryList, _ := fromApi.RetailCatList(utils.Int2Str(fromVendorStoreId))
for _, v := range fromCategoryList {
err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
CategoryCode: v.Code,
Sequence: v.Sequence,
})
if err != nil {
globals.SugarLogger.Debugf("err := RetailCatUpdate : %s", utils.Format4Output(err, false))
}
//err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
// CategoryCode: v.Code,
// Sequence: v.Sequence,
//})
//if err != nil {
// globals.SugarLogger.Debugf("err := RetailCatUpdate : %s", utils.Format4Output(err, false))
//}
if v.Children != nil && len(v.Children) != 0 {
for _, c := range v.Children {
globals.SugarLogger.Debugf("==Children : %s", utils.Format4Output(c, false))
if err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
//CategoryNameOrigin: v.Name,
CategoryCodeOrigin: v.Code,
@@ -70,7 +71,7 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
SecondaryCategoryName: c.Name,
Sequence: c.Sequence,
}); err != nil {
globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %v", utils.Format4Output(err, false))
globals.SugarLogger.Debugf("err := RetailCatUpdate Children : %s", utils.Format4Output(c, false))
}
}
}