处理创建分类是的父子关系
This commit is contained in:
@@ -71,8 +71,12 @@ func (p *PurchaseHandler) GetAllCategories(ctx *jxcontext.Context, vendorOrgCode
|
||||
|
||||
func (p *PurchaseHandler) CreateCategory2(ctx *jxcontext.Context, cat *dao.SkuStoreCatInfo) (err error) {
|
||||
globals.SugarLogger.Debugf("CreateCategory2 cat:%s", utils.Format4Output(cat, true))
|
||||
parentID := int64(0)
|
||||
if cat.Level != 1 {
|
||||
parentID = utils.Str2Int64(cat.ParentVendorCatID)
|
||||
}
|
||||
if globals.EnableJdStoreWrite {
|
||||
result, err2 := getAPI(cat.VendorOrgCode).AddShopCategory(utils.Str2Int64(cat.ParentVendorCatID), cat.Name, int(cat.Level), cat.Seq, ctx.GetUserName())
|
||||
result, err2 := getAPI(cat.VendorOrgCode).AddShopCategory(parentID, cat.Name, int(cat.Level), cat.Seq, ctx.GetUserName())
|
||||
if err = err2; err == nil {
|
||||
if jdID := utils.Str2Int64WithDefault(result, 0); jdID != 0 {
|
||||
cat.VendorCatID = utils.Int64ToStr(jdID)
|
||||
|
||||
Reference in New Issue
Block a user