Browse Source

Merge branch 'cygx_9.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 2 years ago
parent
commit
0d51e045e2
1 changed files with 6 additions and 9 deletions
  1. 6 9
      controllers/report.go

+ 6 - 9
controllers/report.go

@@ -2685,14 +2685,14 @@ func (this *ReportController) SearchReportAndResource() {
 	} else {
 		sqlGroup += ` LIMIT 100 `
 	}
-	ListYxReport, err := models.GetArticleCollectionList(` AND a.article_id >= 1000000 `+condition+sqlGroup, user.UserId)
+	ListYxReport, err := models.GetArticleCollectionList(` AND a.article_type_id IN (`+utils.YAN_XUAN_ARTICLE_TYPE_IDS+`) `+condition+sqlGroup, user.UserId)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取研选文章列表失败,Err:" + err.Error()
 		return
 	}
 
-	ListHzReport, err := models.GetReoprtSearchList(` AND a.article_id < 1000000 `+condition+` OR ( article_type = 'lyjh' `+condition+` ) OR ( a.sub_category_name = '专项调研' `+condition+` )  `+sqlGroup, user.UserId)
+	ListHzReport, err := models.GetReoprtSearchList(` AND a.article_type_id NOT IN (`+utils.YAN_XUAN_ARTICLE_TYPE_IDS+`) `+condition+sqlGroup, user.UserId)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取弘则报告文章列表失败,Err:" + err.Error()
@@ -2719,7 +2719,7 @@ func (this *ReportController) SearchReportAndResource() {
 			sqlGroupIk += ` LIMIT 20 `
 		}
 		//研选的联想词列表
-		ListYxReportIk, err := models.GetArticleCollectionList(` AND a.article_id >= 1000000 `+conditionIk+sqlGroupIk, user.UserId)
+		ListYxReportIk, err := models.GetArticleCollectionList(` AND a.article_type_id IN (`+utils.YAN_XUAN_ARTICLE_TYPE_IDS+`) `+conditionIk+sqlGroupIk, user.UserId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取信息失败"
 			br.ErrMsg = "获取研选IK文章列表失败,Err:" + err.Error()
@@ -2731,7 +2731,7 @@ func (this *ReportController) SearchReportAndResource() {
 			}
 		}
 		//弘则的联想词列表
-		ListHzReportIk, err := models.GetReoprtSearchList(` AND a.article_id < 1000000 `+conditionIk+sqlGroupIk, user.UserId)
+		ListHzReportIk, err := models.GetReoprtSearchList(`  AND a.article_type_id NOT IN (`+utils.YAN_XUAN_ARTICLE_TYPE_IDS+`) `+conditionIk+sqlGroupIk, user.UserId)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取信息失败"
 			br.ErrMsg = "获取研选IK文章列表失败,Err:" + err.Error()
@@ -2824,9 +2824,7 @@ func (this *ReportController) SearchReportAndResource() {
 		}
 	}
 
-	var conditionOr string
-	conditionOr += ` OR ( m.subject_names LIKE '%` + keyWord + `%' AND a.article_id < ` + strconv.Itoa(utils.SummaryArticleId) + `  AND publish_status = 1 ) `
-	condition = ` AND m.industry_name LIKE '%` + keyWord + `%' AND a.article_id < ` + strconv.Itoa(utils.SummaryArticleId) + conditionOr
+	condition = `  AND a.publish_status = 1 AND a.article_type_id NOT IN (` + utils.YAN_XUAN_ARTICLE_TYPE_IDS + `)  AND (m.industry_name LIKE '%` + keyWord + `%' OR m.subject_names LIKE '%` + keyWord + `%'  )  `
 
 	listHzResource, err := models.GetSearchResourceList(user.UserId, condition, 0, pageSize)
 	if err != nil {
@@ -2835,8 +2833,7 @@ func (this *ReportController) SearchReportAndResource() {
 		return
 	}
 
-	conditionOr = ` OR ( m.subject_names LIKE '%` + keyWord + `%' AND a.article_id >= ` + strconv.Itoa(utils.SummaryArticleId) + `  AND publish_status = 1 ) `
-	condition = ` AND m.industry_name LIKE '%` + keyWord + `%' AND a.article_id >= ` + strconv.Itoa(utils.SummaryArticleId) + conditionOr
+	condition = `  AND a.publish_status = 1 AND a.article_type_id IN (` + utils.YAN_XUAN_ARTICLE_TYPE_IDS + `)  AND (m.industry_name LIKE '%` + keyWord + `%' OR m.subject_names LIKE '%` + keyWord + `%'  )  `
 
 	listYxResource, err := models.GetSearchResourceList(user.UserId, condition, 0, pageSize)
 	if err != nil {