|
@@ -212,7 +212,11 @@ func (this *EnglishReportController) AddClassify() {
|
|
|
br.ErrMsg = "查询上级分类信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- rootId = parentClassify.RootId
|
|
|
+ if parentClassify.RootId == 0 {
|
|
|
+ rootId = parentClassify.Id
|
|
|
+ } else {
|
|
|
+ rootId = parentClassify.RootId
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
item := &models.EnglishClassify{
|
|
@@ -296,6 +300,7 @@ func (this *EnglishReportController) EditClassify() {
|
|
|
}
|
|
|
|
|
|
var parent *models.EnglishClassify
|
|
|
+ rootId := 0
|
|
|
if parentId > 0 {
|
|
|
parent, err = models.GetEnglishReportClassifyById(parentId)
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
@@ -305,6 +310,11 @@ func (this *EnglishReportController) EditClassify() {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
+ if parent.RootId == 0 {
|
|
|
+ rootId = parent.Id
|
|
|
+ } else {
|
|
|
+ rootId = parent.RootId
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//判断是否已存在同个名称的分类
|
|
@@ -326,7 +336,7 @@ func (this *EnglishReportController) EditClassify() {
|
|
|
ClassifyName: classifyName,
|
|
|
Sort: sort,
|
|
|
ParentId: parentId,
|
|
|
- RootId: parent.RootId,
|
|
|
+ RootId: rootId,
|
|
|
ModifyTime: time.Now(),
|
|
|
IsShow: 1,
|
|
|
}
|