瀏覽代碼

弘则产业资源包搜索报告

xingzai 2 年之前
父節點
當前提交
8e78ce7949
共有 2 個文件被更改,包括 7 次插入7 次删除
  1. 6 6
      controllers/report.go
  2. 1 1
      models/report.go

+ 6 - 6
controllers/report.go

@@ -2305,9 +2305,9 @@ func (this *ReportController) SearchResource() {
 	keyWord := this.GetString("KeyWord")
 	var condition string
 	var conditionOr string
-	conditionOr = `OR ( a.title LIKE '%` + keyWord + `%' AND m.chart_permission_id != 31 AND publish_status = 1 ) `
-	conditionOr += `OR ( a.body LIKE '%` + keyWord + `%' AND m.chart_permission_id != 31 AND publish_status = 1 ) `
-	condition = conditionOr + `AND m.industry_name LIKE '%` + keyWord + `%' AND m.chart_permission_id != 31 GROUP BY m.industrial_management_id `
+	conditionOr = ` OR ( a.title LIKE '%` + keyWord + `%' AND a.article_id < ` + strconv.Itoa(utils.SummaryArticleId) + `  AND publish_status = 1 ) `
+	conditionOr += ` OR ( a.body 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
 
 	listHz, err := models.GetSearchResourceList(condition)
 	if err != nil {
@@ -2315,9 +2315,9 @@ func (this *ReportController) SearchResource() {
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
 		return
 	}
-	conditionOr = `OR ( a.title LIKE '%` + keyWord + `%' AND m.chart_permission_id = 31 AND publish_status = 1 ) `
-	conditionOr += `OR ( a.body LIKE '%` + keyWord + `%' AND m.chart_permission_id = 31 AND publish_status = 1 ) `
-	condition = conditionOr + `AND m.industry_name LIKE '%` + keyWord + `%' AND m.chart_permission_id = 31 GROUP BY m.industrial_management_id `
+	conditionOr = ` OR ( a.title LIKE '%` + keyWord + `%' AND a.article_id >= ` + strconv.Itoa(utils.SummaryArticleId) + `  AND publish_status = 1 ) `
+	conditionOr += ` OR ( a.body 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
 
 	listYx, err := models.GetSearchResourceList(condition)
 	if err != nil {

+ 1 - 1
models/report.go

@@ -684,7 +684,7 @@ func GetSearchResourceList(condition string) (items []*IndustrialManagementHotRe
 			INNER JOIN cygx_article AS a ON a.article_id = mg.article_id 
 		WHERE
 			1 = 1 
-			AND publish_status = 1 ` + condition
+			AND publish_status = 1 ` + condition + ` GROUP BY m.industrial_management_id `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }