diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index b72d4a0a6..7a87bd61b 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -2905,12 +2905,9 @@ func LoadStoreVendorCategories(ctx *jxcontext.Context, vendorOrgCode string, ven db = dao.GetDB() ) - if storeCats, err := dao.GetStoreCategoryMap(db, -1, 0, storeID, 0); err == nil { - if len(storeCats) == 0 { - return fmt.Errorf("未查询到该门店有门店分类,请重新选择! [%v]", storeID) - } - } else { - return err + storeCats, err := dao.GetStoreCategoryMap(db, -1, 0, storeID, 0) + if len(storeCats) == 0 { + return fmt.Errorf("未查询到该门店有门店分类,请重新选择! [%v]", storeID) } dao.Begin(db) defer func() { @@ -2948,5 +2945,13 @@ func LoadStoreVendorCategories(ctx *jxcontext.Context, vendorOrgCode string, ven return err } dao.Commit(db) + for _, v := range storeCats { + OnUpdateThing(ctx, db, []*MultiStoreVendorInfo{ + &MultiStoreVendorInfo{ + VendorID: vendorID, + OrgCode: vendorOrgCode, + }, + }, int64(v.CategoryID), model.ThingTypeCategory) + } return err }