|
@@ -44,7 +44,7 @@ func (this *HelpDocController) Add() {
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println("Id:",req.Id)
|
|
|
+ fmt.Println("Id:", req.Id)
|
|
|
if req.Content == "" {
|
|
|
br.Msg = "请输入内容"
|
|
|
return
|
|
@@ -227,11 +227,28 @@ func (this *HelpDocController) ListReport() {
|
|
|
}
|
|
|
|
|
|
if len(classifyIds) > 0 {
|
|
|
- classifyIdSlice := strings.Split(classifyIds,",")
|
|
|
+ classifyIdSlice := strings.Split(classifyIds, ",")
|
|
|
condition += ` AND classify_id IN ( ` + utils.GetOrmInReplace(len(classifyIdSlice)) + ` ) `
|
|
|
pars = append(pars, classifyIdSlice)
|
|
|
}
|
|
|
|
|
|
+ //拿到所有分类信息,显示路径用
|
|
|
+ classifyAll, err := help_doc.GetAllHelpDocClassify()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ parentMap := make(map[int]int)
|
|
|
+ classifyNameMap := make(map[int]string)
|
|
|
+ for _, v := range classifyAll {
|
|
|
+ classifyNameMap[v.ClassifyId] = v.ClassifyName
|
|
|
+ if v.ParentId != 0 {
|
|
|
+ parentMap[v.ClassifyId] = v.ParentId
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
total, err := help_doc.GetHelpDocListCount(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -281,7 +298,17 @@ func (this *HelpDocController) ListReport() {
|
|
|
Anchor: anchor,
|
|
|
Recommend: recommend,
|
|
|
}
|
|
|
-
|
|
|
+ if pid, ok := parentMap[respItem.ClassifyId]; ok {
|
|
|
+ pName := classifyNameMap[pid]
|
|
|
+ if ppid, ok := parentMap[pid]; ok {
|
|
|
+ ppName := classifyNameMap[ppid]
|
|
|
+ respItem.ClassifyName = ppName + "/" + pName + "/" + classifyNameMap[respItem.ClassifyId]
|
|
|
+ } else {
|
|
|
+ respItem.ClassifyName = pName + "/" + classifyNameMap[respItem.ClassifyId]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ respItem.ClassifyName = classifyNameMap[respItem.ClassifyId]
|
|
|
+ }
|
|
|
resp.List = append(resp.List, &respItem)
|
|
|
}
|
|
|
|
|
@@ -399,4 +426,4 @@ func (this *HelpDocController) Delete() {
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "删除成功"
|
|
|
-}
|
|
|
+}
|