activity_fastsearch_keywords.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type ActivityFastsearchKeywords struct {
  6. Id int `description:"活动类型id"`
  7. KeyWord string `description:"关键词"`
  8. }
  9. type ActivityFastsearchKeywordsResp struct {
  10. KeyWord string `description:"关键词(标签)"`
  11. MirrorWord string `description:"关键词的镜像词"`
  12. ListWords []*MirrorWordResp `description:"关键词的镜像词列表(公司)"`
  13. }
  14. type MirrorWordResp struct {
  15. MirrorWord string `description:"关键词的镜像词(公司)"`
  16. }
  17. type FastsearchKeyType struct {
  18. KeyType string `description:"关键词类型 ‘活动:Activity’,’纪要:Summary'"`
  19. }
  20. type ActivityFastsearchKeywordsListResp struct {
  21. List []*ActivityFastsearchKeywordsResp
  22. }
  23. // 列表
  24. func GetActivityFastsearchKeywordsList() (items []*ActivityFastsearchKeywordsResp, err error) {
  25. o := orm.NewOrmUsingDB("hz_cygx")
  26. sql := `SELECT f.*,
  27. GROUP_CONCAT( DISTINCT m.key_word SEPARATOR ',' ) AS mirror_word
  28. FROM
  29. cygx_activity_fastsearch_keywords AS f
  30. LEFT JOIN cygx_activity_mirror_word AS m ON m.mirror_key_word = f.key_word
  31. GROUP BY f.id
  32. ORDER BY f.sort DESC`
  33. _, err = o.Raw(sql).QueryRows(&items)
  34. return
  35. }