xyxie 1 an în urmă
părinte
comite
ac18bab683
1 a modificat fișierele cu 8 adăugiri și 5 ștergeri
  1. 8 5
      controllers/english_report/english_classify.go

+ 8 - 5
controllers/english_report/english_classify.go

@@ -303,13 +303,16 @@ func (this *EnglishReportController) EditClassify() {
 	rootId := 0
 	if parentId > 0 {
 		parent, err = models.GetEnglishReportClassifyById(parentId)
-		if err.Error() == utils.ErrNoRow() {
-			br.Msg = "上级分类不存在"
+		if err != nil {
+			if err.Error() == utils.ErrNoRow() {
+				br.Msg = "上级分类不存在"
+				return
+			}
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取信息失败,Err:" + err.Error()
 			return
 		}
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		return
+		
 		if parent.RootId == 0 {
 			rootId = parent.Id
 		} else {