Browse Source

no message

xingzai 1 year ago
parent
commit
7794d4a2ed
2 changed files with 21 additions and 20 deletions
  1. 20 19
      controllers/cygx/report_article.go
  2. 1 1
      models/cygx/report_article.go

+ 20 - 19
controllers/cygx/report_article.go

@@ -186,7 +186,7 @@ func (this *ReportArticleController) ReportArticleList() {
 	}
 	//主题
 	if subCategoryName != "" {
-		condition += ` AND ret.sub_category_name  =  ` + "'" + subCategoryName + "' "
+		condition += ` AND art.sub_category_name  =  ` + "'" + subCategoryName + "' "
 	}
 	//发布时间
 	if startDate != "" {
@@ -198,25 +198,26 @@ func (this *ReportArticleController) ReportArticleList() {
 	//报告匹配类型
 	if matchTypeName != "" && chartPermissionId > 0 {
 		//condition += ` AND re.match_type_name  =  ` + "'" + matchTypeName + "' "
-		mappingCygxDetai, err := cygx.GetCygxReportMappingCygxDetailByNameAndChartPermissionId(matchTypeName, chartPermissionId)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取失败,Err:" + err.Error()
-			return
-		}
-		if mappingCygxDetai == nil {
-			resp := new(cygx.GetReportArticleListRep)
-			resp.List = make([]*cygx.CygxReportArticle, 0)
-			page := paging.GetPaging(currentIndex, pageSize, 0)
-			resp.Paging = page
-			br.Ret = 200
-			br.Success = true
-			br.Msg = "获取成功"
-			br.Data = resp
-			return
-		}
+		//mappingCygxDetai, err := cygx.GetCygxReportMappingCygxDetailByNameAndChartPermissionId(matchTypeName, chartPermissionId)
+		//if err != nil && err.Error() != utils.ErrNoRow() {
+		//	br.Msg = "获取失败"
+		//	br.ErrMsg = "获取失败,Err:" + err.Error()
+		//	return
+		//}
+		//if mappingCygxDetai == nil {
+		//	resp := new(cygx.GetReportArticleListRep)
+		//	resp.List = make([]*cygx.CygxReportArticle, 0)
+		//	page := paging.GetPaging(currentIndex, pageSize, 0)
+		//	resp.Paging = page
+		//	br.Ret = 200
+		//	br.Success = true
+		//	br.Msg = "获取成功"
+		//	br.Data = resp
+		//	return
+		//}
 		//这里量不大,走一下子查询
-		condition += ` 	AND art.category_id IN ( SELECT category_id_celue FROM cygx_report_mapping_group WHERE id_cygx = ` + strconv.Itoa(mappingCygxDetai.Id) + ` )  `
+		//condition += ` 	AND art.category_id IN ( SELECT category_id_celue FROM cygx_report_mapping_group WHERE id_cygx = ` + strconv.Itoa(mappingCygxDetai.Id) + ` )  `
+		condition += ` 	AND art.category_id IN ( SELECT category_id FROM cygx_report_mapping WHERE match_type_name = ` + "'" + matchTypeName + "'" + ` )  `
 	}
 	// 报告标签
 	if reportLabel != "" {

+ 1 - 1
models/cygx/report_article.go

@@ -98,7 +98,7 @@ func GetReportArticleList(condition string, pars []interface{}, startSize, pageS
 				art.article_id_md5,
 				re.chart_permission_name,
 				re.match_type_name,
-				ret.sub_category_name,
+				art.sub_category_name,
 				re.chart_permission_id
 			FROM
 				cygx_article AS art