瀏覽代碼

no message

zhangchuanxing 1 周之前
父節點
當前提交
0e10c1e714
共有 1 個文件被更改,包括 25 次插入8 次删除
  1. 25 8
      controllers/search.go

+ 25 - 8
controllers/search.go

@@ -306,24 +306,41 @@ func (this *MobileSearchController) BrowseHistoryList() {
 		return
 		return
 	}
 	}
 	resp := new(models.ConfigResp)
 	resp := new(models.ConfigResp)
-	hotSearch, err := models.GetHotSearch()
+	//hotSearch, err := models.GetHotSearch()
+	//if err != nil {
+	//	br.Msg = "获取数据失败"
+	//	br.ErrMsg = "获取数据失败,Err:" + err.Error()
+	//	return
+	//}
+	//slicehotSearch := strings.Split(hotSearch, ",")
+	//for _, v := range slicehotSearch {
+	//	if v == "" {
+	//		continue
+	//	}
+	//	slicehotSearchList := strings.Split(v, "/")
+	//	for _, v2 := range slicehotSearchList {
+	//		item := new(models.KeyWord)
+	//		item.KeyWord = v2
+	//		resp.ListRecommend = append(resp.ListRecommend, item)
+	//	}
+	//}
+
+	detailConfig, err := models.GetConfigByCode("cygx_report_selection_subject")
 	if err != nil {
 	if err != nil {
 		br.Msg = "获取数据失败"
 		br.Msg = "获取数据失败"
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 		return
 	}
 	}
-	slicehotSearch := strings.Split(hotSearch, ",")
+	slicehotSearch := strings.Split(detailConfig.ConfigValue, ",")
 	for _, v := range slicehotSearch {
 	for _, v := range slicehotSearch {
 		if v == "" {
 		if v == "" {
 			continue
 			continue
 		}
 		}
-		slicehotSearchList := strings.Split(v, "/")
-		for _, v2 := range slicehotSearchList {
-			item := new(models.KeyWord)
-			item.KeyWord = v2
-			resp.ListRecommend = append(resp.ListRecommend, item)
-		}
+		item := new(models.KeyWord)
+		item.KeyWord = v
+		resp.ListRecommend = append(resp.ListRecommend, item)
 	}
 	}
+
 	var condition string
 	var condition string
 	var pars []interface{}
 	var pars []interface{}
 	starTime := time.Now().AddDate(0, 0, -8).Format(utils.FormatDate)
 	starTime := time.Now().AddDate(0, 0, -8).Format(utils.FormatDate)