wangkaiyue před 2 roky
rodič
revize
7a2ad57a2d
2 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. 4 4
      src/jfw/front/classificationTag.go
  2. 2 2
      src/jfw/front/tags.go

+ 4 - 4
src/jfw/front/classificationTag.go

@@ -241,8 +241,8 @@ func GetLetterPaging(pageNum int, checkedLetter string) (letterList []map[string
 
 func GetLetterMap(pageSize, pageNum int64, letter string) ([]map[string]interface{}, int64) {
 	m := []map[string]interface{}{}
-	sql := `select id,name,letter from seo_words.seo_resource where letter = ? order by id desc`
-	cql := `select count(1) from seo_words.seo_resource where letter = ?`
+	sql := `select id,name,letter from seo_words.seo_resource where letter = ? and state=1 order by id desc`
+	cql := `select count(1) from seo_words.seo_resource where letter = ? and state=1`
 	offset := (pageNum - 1) * pageSize
 	sql += fmt.Sprintf(" limit %v,%v", offset, pageSize)
 	data := public.BaseMysql.SelectBySql(sql, letter)
@@ -393,10 +393,10 @@ func HotKey() []string {
 		return rData
 	}
 	num := 7
-	count := public.BaseMysql.CountBySql(`select count(1) from seo_words.seo_resource;`)
+	count := public.BaseMysql.CountBySql(`select count(1) from seo_words.seo_resource where state=1;`)
 	rand.Seed(time.Now().UnixNano())
 	randNum := rand.Intn(int(count) - num)
-	data := public.BaseMysql.SelectBySql(`select name from seo_words.seo_resource limit ?,?`, randNum, num)
+	data := public.BaseMysql.SelectBySql(`select name from seo_words.seo_resource where state=1 limit ?,?`, randNum, num)
 	arr := []string{}
 	for _, v := range *data {
 		arr = append(arr, qu.ObjToString(v["name"]))

+ 2 - 2
src/jfw/front/tags.go

@@ -583,8 +583,8 @@ func (this *Tags) GetHotLabel(length int64) []map[string]interface{} {
 		return qu.ObjArrToMapArr(l)
 	} else {
 		m := []map[string]interface{}{}
-		sql := `select id,name,letter from seo_words.seo_resource`
-		cql := `select count(1) from seo_words.seo_resource `
+		sql := `select id,name,letter from seo_words.seo_resource where state=1`
+		cql := `select count(1) from seo_words.seo_resource where state=1`
 		count := public.BaseMysql.CountBySql(cql)
 		rand.Seed(time.Now().UnixNano())
 		offset := rand.Intn(int(count / length))