浏览代码

fix:修复菜单栏返回bug

Roc 2 年之前
父节点
当前提交
ffcbdd0a6e

+ 0 - 5
controllers/report.go

@@ -2,7 +2,6 @@ package controllers
 
 import (
 	"encoding/json"
-	"fmt"
 	"github.com/rdlucklib/rdluck_tools/common"
 	"hongze/hongze_open_api/logic"
 	"hongze/hongze_open_api/models/request/article"
@@ -56,7 +55,6 @@ func (c *ReportController) ListReport() {
 	var mobile string
 	URL, err := url.Parse(c.Ctx.Input.URI())
 	if err != nil {
-		fmt.Println(err)
 		c.FailWithMessage("获取报告失败")
 		return
 	}
@@ -185,7 +183,6 @@ func (c *ReportControllerCommon) GetReportInfo() {
 	}
 	reportInfo, hasPermission, err := tables.GetResearchReportInfo(researchReportId, userInfo.UserId)
 	if err != nil {
-		fmt.Println(err)
 		c.FailWithMessage("获取报告失败")
 		return
 	}
@@ -256,7 +253,6 @@ func (c *ReportControllerCommon) GetResearchReportChapter() {
 
 	reportInfo, hasPermission, err := tables.GetResearchReportTypeContentInfo(uint64(researchReportTypeId), uint64(userInfo.UserId))
 	if err != nil {
-		fmt.Println(err)
 		c.FailWithMessage("获取报告失败")
 		return
 	}
@@ -373,7 +369,6 @@ func (c *ReportController) ListReportV2() {
 	var mobile string
 	URL, err := url.Parse(c.Ctx.Input.URI())
 	if err != nil {
-		fmt.Println(err)
 		c.FailWithMessage("获取报告失败")
 		return
 	}

+ 2 - 0
logic/report.go

@@ -541,6 +541,8 @@ func GetChapterDetail(mobile string, reportChapterId int) (reportChapterDetail r
 
 // GetMenuChapter 获取章节下面的菜单
 func GetMenuChapter(reportId int, typeIds []int, classifyNameFirst string, reportCreateTime time.Time, encryptMobile string) (reportTypeList reportResp.ReportChapterMenuList, err error) {
+	reportTypeList = make([]reportResp.ReportChapterMenu, 0)
+
 	//查询有效的章节
 	typeList, tErr := report_chapter_type.GetEffectTypes()
 	if tErr != nil {

+ 0 - 3
models/tables/chart_permission_chapter_mapping/chart_permission_chapter_mapping.go

@@ -1,7 +1,6 @@
 package chart_permission_chapter_mapping
 
 import (
-	"fmt"
 	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_open_api/utils"
 )
@@ -43,7 +42,6 @@ func GetPermissionIdsByReportId(reportId int, researchType string) (ids []int, e
 		return
 	}
 
-	fmt.Println(list)
 	if len(list) > 0 {
 		for _, item := range list {
 			ids = append(ids, item.ChartPermissionId)
@@ -63,7 +61,6 @@ func GetPermissionIdsByWeek() (ids []int, err error) {
 		return
 	}
 
-	fmt.Println(list)
 	if len(list) > 0 {
 		for _, item := range list {
 			ids = append(ids, item.ChartPermissionId)

+ 3 - 3
models/tables/rddp/report_chapter/report_chapter.go

@@ -71,14 +71,14 @@ func GetListByReportIdTypeIds(reportId int, typeIds []int, classifyNameFirst str
 	}
 	var where string
 	if classifyNameFirst == "周报" {
-		where = `report_id = ? AND type_id in (` + utils.GetOrmInReplace(lenNum) + `) AND is_edit = 1 AND publish_state = 2 `
+		where = ` report_id = ? AND type_id in (` + utils.GetOrmInReplace(lenNum) + `) AND is_edit = 1 AND publish_state = 2 `
 	} else {
 		where = ` report_id = ? AND type_id in (` + utils.GetOrmInReplace(lenNum) + `) AND publish_state = 2 `
 	}
 
 	o := orm.NewOrmUsingDB("rddp")
-	sql := `SELECT * FROM report_chapter WHERE   ` + where
+	sql := `SELECT * FROM report_chapter WHERE ` + where
 	sql += ` order by sort asc,report_chapter_id asc  `
-	_, err = o.Raw(sql, reportId).QueryRows(&list)
+	_, err = o.Raw(sql, reportId, typeIds).QueryRows(&list)
 	return
 }