ziwen 1 year ago
parent
commit
82f68c007c
2 changed files with 3 additions and 56 deletions
  1. 3 4
      controllers/help_doc/classify.go
  2. 0 52
      models/help_doc/classify.go

+ 3 - 4
controllers/help_doc/classify.go

@@ -44,7 +44,7 @@ func (this *HelpDocClassifyController) ListClassify() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
-	rootListAll := make([]help_doc.HelpDocClassifyItems,0)
+	rootListAll := make([]help_doc.HelpDocClassifyItems, 0)
 	rootListAll = rootList
 	nodeAll := make([]*help_doc.HelpDocClassifyItems, 0)
 	for k := range rootListAll {
@@ -60,7 +60,7 @@ func (this *HelpDocClassifyController) ListClassify() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
-	rootListLevel := make([]help_doc.HelpDocClassifyItems,0)
+	rootListLevel := make([]help_doc.HelpDocClassifyItems, 0)
 	rootListLevel = rootList
 	nodeAllTwoLevel := make([]*help_doc.HelpDocClassifyItems, 0)
 	for k := range rootListLevel {
@@ -69,7 +69,6 @@ func (this *HelpDocClassifyController) ListClassify() {
 		nodeAllTwoLevel = append(nodeAllTwoLevel, &rootNode)
 	}
 
-
 	resp.AllNodes = nodeAll
 	resp.TwoLevelNodes = nodeAllTwoLevel
 	br.Ret = 200
@@ -405,4 +404,4 @@ func (this *HelpDocClassifyController) ClassifyMove() {
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "移动成功"
-}
+}

+ 0 - 52
models/help_doc/classify.go

@@ -63,24 +63,6 @@ func EditHelpDocClassify(classifyId int, HelpDocClassifyName string) (err error)
 	return
 }
 
-func GetChartInfoCountByClassifyId(classifyId int) (count int, err error) {
-	o := orm.NewOrm()
-	sql := ` SELECT COUNT(1) AS count FROM chart_info AS a
-				WHERE a.classify_id IN(
-				SELECT t.classify_id FROM 
-				(
-				SELECT rd.*
-				FROM (SELECT * FROM help_doc_classify WHERE parent_id IS NOT NULL) rd,
-					 (SELECT @pid := ?) pd 
-				WHERE FIND_IN_SET(parent_id, @pid) > 0 
-				  AND @pid := CONCAT(@pid, ',', classify_id) 
-				UNION SELECT * FROM help_doc_classify WHERE classify_id = @pid
-				)AS t
-				) `
-	err = o.Raw(sql, classifyId).QueryRow(&count)
-	return
-}
-
 // GetHelpDocClassifyByParentId
 func GetHelpDocClassifyByParentId(parentId int, keyWord string) (items []HelpDocClassifyItems, err error) {
 	o := orm.NewOrm()
@@ -192,40 +174,6 @@ type HelpDocClassifyView struct {
 	ParentId            int    `description:"父级id"`
 }
 
-func GetHelpDocClassifyViewById(classifyId int) (item *HelpDocClassifyView, err error) {
-	o := orm.NewOrm()
-	sql := `SELECT * FROM help_doc_classify WHERE classify_id=? `
-	err = o.Raw(sql, classifyId).QueryRow(&item)
-	return
-}
-
-func GetHelpDocClassifyByParentIdFromETA(parentId int) (items []*HelpDocClassifyItems, err error) {
-	o := orm.NewOrm()
-	sql := ` SELECT * FROM help_doc_classify WHERE parent_id=? AND source = 1 order by sort asc,classify_id asc`
-	_, err = o.Raw(sql, parentId).QueryRows(&items)
-	return
-}
-
-func GetHelpDocClassifyAllFromETA() (items []*HelpDocClassifyItems, err error) {
-	o := orm.NewOrm()
-	sql := ` SELECT * FROM help_doc_classify WHERE parent_id<>0 AND source = 1 order by sort asc,classify_id asc`
-	_, err = o.Raw(sql).QueryRows(&items)
-	return
-}
-
-func GetHelpDocClassifyTwo(source int) (items []*HelpDocClassifyItems, err error) {
-	o := orm.NewOrm()
-	sql := ` SELECT * FROM help_doc_classify WHERE level=3 AND source = ? order by sort asc,classify_id asc`
-	_, err = o.Raw(sql, source).QueryRows(&items)
-	return
-}
-
-func GetHelpDocClassifyByLevel(level, source int) (items []*HelpDocClassifyItems, err error) {
-	o := orm.NewOrm()
-	sql := ` SELECT * FROM help_doc_classify WHERE level=? AND source = ? order by sort asc,classify_id asc`
-	_, err = o.Raw(sql, level, source).QueryRows(&items)
-	return
-}
 
 func EditHelpDocClassifySysUser(classifyId, sysUserId int, HelpDocClassifyName string) (err error) {
 	o := orm.NewOrm()