askserie_video.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type CygxAskserieVideoResp struct {
  4. AskserieVideoId int `orm:"column(askserie_video_id);pk"description:"视频id"`
  5. VideoName string `description:"视频标题"`
  6. VideoUrl string `description:"视频地址"`
  7. VideoDuration int `description:"视频时长"`
  8. ChartPermissionId int `description:"行业ID"`
  9. ChartPermissionName string `description:"行业名称"`
  10. PublishStatus int `description:"发布状态 1发布 0没有"`
  11. VideoCounts int `description:"播放量"`
  12. CommentNum int `description:"留言总数"`
  13. BackgroundImg string `description:"封面图片"`
  14. ShareImg string `description:"分享图片"`
  15. AdminId int `description:"管理员、销售ID"`
  16. IndustryName string `description:"产业名称"`
  17. ModifyDate string `description:"更新时间"`
  18. PublishDate string `description:"发布时间"`
  19. CreateTime string `description:"创建时间"`
  20. }
  21. // GetCygxAskserieVideoCountByVideoId 根据视频ID查询产业视频是否存在
  22. func GetCygxAskserieVideoCountByVideoId(askserieVideoId int) (count int, err error) {
  23. o := orm.NewOrm()
  24. sql := `SELECT COUNT(1) count
  25. FROM cygx_askserie_video WHERE askserie_video_id = ?`
  26. err = o.Raw(sql, askserieVideoId).QueryRow(&count)
  27. return
  28. }
  29. type GetCygxAskserieVideoDetailResp struct {
  30. Detail *CygxAskserieVideoResp
  31. }
  32. // 通过ID获取详情
  33. func GetCygxAskserieVideoDetail(askserieVideoId int) (item *CygxAskserieVideoResp, err error) {
  34. o := orm.NewOrm()
  35. sql := `SELECT * FROM cygx_askserie_video WHERE askserie_video_id=? `
  36. err = o.Raw(sql, askserieVideoId).QueryRow(&item)
  37. return
  38. }