classify.go 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package ficc_report
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type Classify struct {
  7. Id int `gorm:"column:id" db:"id" json:"id" form:"id"`
  8. ClassifyName string `gorm:"column:classify_name" db:"classify_name" json:"classify_name" form:"classify_name"` //分类名称
  9. Sort int8 `gorm:"column:sort" db:"sort" json:"sort" form:"sort"` //排序
  10. ParentId int `gorm:"column:parent_id" db:"parent_id" json:"parent_id" form:"parent_id"` //父级分类id
  11. CreateTime time.Time `gorm:"column:create_time" db:"create_time" json:"create_time" form:"create_time"`
  12. ModifyTime time.Time `gorm:"column:modify_time" db:"modify_time" json:"modify_time" form:"modify_time"`
  13. Abstract string `gorm:"column:abstract" db:"abstract" json:"abstract" form:"abstract"` //栏目简介
  14. Descript string `gorm:"column:descript" db:"descript" json:"descript" form:"descript"` //分享描述
  15. ReportAuthor string `gorm:"column:report_author" db:"report_author" json:"report_author" form:"report_author"` //栏目作者
  16. AuthorDescript string `gorm:"column:author_descript" db:"author_descript" json:"author_descript" form:"author_descript"` //作者简介
  17. ReportImgUrl string `gorm:"column:report_img_url" db:"report_img_url" json:"report_img_url" form:"report_img_url"` //报告配图
  18. HeadImgUrl string `gorm:"column:head_img_url" db:"head_img_url" json:"head_img_url" form:"head_img_url"` //头部banner
  19. AvatarImgUrl string `gorm:"column:avatar_img_url" db:"avatar_img_url" json:"avatar_img_url" form:"avatar_img_url"` //头像
  20. ColumnImgUrl string `gorm:"column:column_img_url" db:"column_img_url" json:"column_img_url" form:"column_img_url"` //栏目配图
  21. IsHomeColumn int8 `gorm:"column:is_home_column" db:"is_home_column" json:"is_home_column" form:"is_home_column"` //1:首页专栏
  22. HomeImgUrl string `gorm:"column:home_img_url" db:"home_img_url" json:"home_img_url" form:"home_img_url"` //首页配图
  23. ClassifyLabel string `gorm:"column:classify_label" db:"classify_label" json:"classify_label" form:"classify_label"`
  24. ShowType uint8 `gorm:"column:show_type" db:"show_type" json:"show_type" form:"show_type"` //展示类型:1-列表 2-专栏
  25. HasTeleconference uint8 `gorm:"column:has_teleconference" db:"has_teleconference" json:"has_teleconference" form:"has_teleconference"` //是否有电话会 0-否 1-是
  26. VipTitle string `gorm:"column:vip_title" db:"vip_title" json:"vip_title" form:"vip_title"` //研究员头衔
  27. YbIconUrl string `gorm:"column:yb_icon_url" db:"yb_icon_url" json:"yb_icon_url" form:"yb_icon_url"` //研报3.0已购页面icon图片地址
  28. YbBgUrl string `gorm:"column:yb_bg_url" db:"yb_bg_url" json:"yb_bg_url" form:"yb_bg_url"` //研报3.0已购详情背景图地址
  29. IsShow int8 `gorm:"column:is_show" db:"is_show" json:"is_show" form:"is_show"` //是否展示报告:1,展示该分类下的报告,0隐藏分类下的报告
  30. YbFiccIcon string `gorm:"column:yb_ficc_icon" db:"yb_ficc_icon" json:"yb_ficc_icon" form:"yb_ficc_icon"` //研报小程序端ficc页码图标
  31. YbFiccPcIcon string `gorm:"column:yb_ficc_pc_icon" db:"yb_ficc_pc_icon" json:"yb_ficc_pc_icon" form:"yb_ficc_pc_icon"` //研报 pc端ficc页码图标
  32. YbFiccSort int `gorm:"column:yb_ficc_sort" db:"yb_ficc_sort" json:"yb_ficc_sort" form:"yb_ficc_sort"` //研报小程序端ficc页面排序
  33. YbListImg string `gorm:"column:yb_list_img" db:"yb_list_img" json:"yb_list_img" form:"yb_list_img"` //研报小程序端报告列表封面图
  34. YbShareBgImg string `gorm:"column:yb_share_bg_img;" db:"yb_share_bg_img" json:"yb_share_bg_img" form:"yb_share_bg_img"`
  35. YbRightBanner string `gorm:"column:yb_right_banner;" db:"yb_right_banner" json:"yb_right_banner" form:"yb_right_banner"` // 研报小程序-报告分享背景图
  36. Level int `gorm:"column:level" db:"level" json:"level" form:"level"` // 层级
  37. HasChild int `gorm:"column:has_child" db:"has_child" json:"has_child" form:"has_child"` //是否有子级别,0:下面没有子分类,1:下面有子分类;默认:0
  38. ReportDetailShowType uint8 `gorm:"column:report_detail_show_type" db:"report_detail_show_type" json:"report_detail_show_type" form:"report_detail_show_type"` // 报告详情的展示类型:1-拼接;2:目录
  39. }
  40. // GetByClassifyId 根据分类ID查询分类详情
  41. func GetByClassifyId(id int) (item *Classify, err error) {
  42. o := orm.NewOrmUsingDB("rddp")
  43. sql := `SELECT * FROM classify WHERE id = ? AND is_show = 1 AND enabled = 1 `
  44. err = o.Raw(sql, id).QueryRow(&item)
  45. return
  46. }