chart_all.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxChartAll struct {
  7. Id int `orm:"column(id);pk"`
  8. ChartId int `description:"图表id"`
  9. PtagId int `description:"图表父类分类id"`
  10. CtagId int `description:"图表子类分类id"`
  11. PtagIdTwo int `description:"图表父类分类id"`
  12. CtagIdTwo int `description:"图表子类分类id"`
  13. Title string `description:"标题"`
  14. TitleEn string `description:"英文标题 "`
  15. CreateDate string `description:"本地创建时间"`
  16. CreateDateApi time.Time `description:"图表创建时间"`
  17. PublishStatus int `description:"发布状态"`
  18. PtagName string `description:"父类名称"`
  19. CtagName string `description:"子类名称"`
  20. Cover string `description:"图表图片"`
  21. Iframe string `description:"图表详情跳转地址"`
  22. PtagNameTwo string `description:"父类名称"`
  23. CtagNameTwo string `description:"子类名称"`
  24. }
  25. //获取所有同步过来的图表
  26. func GetChartAllListAll() (items []*HomeChartListResp, err error) {
  27. o := orm.NewOrm()
  28. sql := ` SELECT chart_id FROM cygx_chart_all `
  29. _, err = o.Raw(sql).QueryRows(&items)
  30. return
  31. }
  32. //新增图表
  33. func AddCygxChartAll(item *CygxChartAll) (lastId int64, err error) {
  34. o := orm.NewOrm()
  35. lastId, err = o.Insert(item)
  36. return
  37. }