Browse Source

搜索词推荐

xingzai 2 years ago
parent
commit
c82d1ce32e
1 changed files with 12 additions and 11 deletions
  1. 12 11
      models/config.go

+ 12 - 11
models/config.go

@@ -39,17 +39,18 @@ func GetShowSustainable() (count int, err error) {
 
 // 通过报告精选来获取最新的推荐搜索词
 func GetHotSearch() (permission string, err error) {
-	sql := ` SELECT
-	GROUP_CONCAT(DISTINCT s.subject_name  ORDER BY rl.article_sun_id ASC  SEPARATOR ',') AS subject_name 
-FROM
-	cygx_report_selection_log AS rl
-	INNER JOIN cygx_industrial_subject AS s ON s.industrial_subject_id = rl.industrial_subject_id 
-WHERE
-	rl.article_id = (
-	SELECT
-		MAX( article_id ) 
-FROM
-	cygx_report_selection WHERE publish_status = 1)`
+	sql := `SELECT
+			GROUP_CONCAT( DISTINCT rl.subject_name ORDER BY rl.article_sun_id ASC SEPARATOR ',' ) AS subject_name 
+		FROM
+			cygx_report_selection_log AS rl 
+		WHERE
+			rl.article_id = (
+			SELECT
+				MAX( article_id ) 
+			FROM
+				cygx_report_selection 
+		WHERE
+			publish_status = 1)`
 	o := orm.NewOrm()
 	err = o.Raw(sql).QueryRow(&permission)
 	return