- ReorderCategories
This commit is contained in:
@@ -74,7 +74,12 @@ func ReorderCategories(parentID int, categoryIDs []int, userName string) (err er
|
||||
parentCat := &model.SkuCategory{}
|
||||
parentCat.ID = parentID
|
||||
db := dao.GetDB()
|
||||
if err = dao.GetEntity(db, parentCat); err == nil {
|
||||
if parentID != 0 {
|
||||
err = dao.GetEntity(db, parentCat)
|
||||
} else {
|
||||
parentCat = nil
|
||||
}
|
||||
if err == nil {
|
||||
if err = dao.GetEntities(db, &cats, utils.Params2Map(model.FieldParentID, parentID), false); err == nil {
|
||||
catsLen := len(cats)
|
||||
if catsLen != len(categoryIDs) {
|
||||
|
||||
Reference in New Issue
Block a user