package models import "github.com/beego/beego/v2/client/orm" type CygxAskserieVideoResp struct { AskserieVideoId int `orm:"column(askserie_video_id);pk"description:"视频id"` VideoName string `description:"视频标题"` VideoUrl string `description:"视频地址"` VideoDuration int `description:"视频时长"` ChartPermissionId int `description:"行业ID"` ChartPermissionName string `description:"行业名称"` PublishStatus int `description:"发布状态 1发布 0没有"` VideoCounts int `description:"播放量"` CommentNum int `description:"留言总数"` BackgroundImg string `description:"封面图片"` ShareImg string `description:"分享图片"` AdminId int `description:"管理员、销售ID"` IndustryName string `description:"产业名称"` ModifyDate string `description:"更新时间"` PublishDate string `description:"发布时间"` CreateTime string `description:"创建时间"` } // GetCygxAskserieVideoCountByVideoId 根据视频ID查询产业视频是否存在 func GetCygxAskserieVideoCountByVideoId(askserieVideoId int) (count int, err error) { o := orm.NewOrm() sql := `SELECT COUNT(1) count FROM cygx_askserie_video WHERE askserie_video_id = ?` err = o.Raw(sql, askserieVideoId).QueryRow(&count) return } type GetCygxAskserieVideoDetailResp struct { Detail *CygxAskserieVideoResp } // 通过ID获取详情 func GetCygxAskserieVideoDetail(askserieVideoId int) (item *CygxAskserieVideoResp, err error) { o := orm.NewOrm() sql := `SELECT * FROM cygx_askserie_video WHERE askserie_video_id=? ` err = o.Raw(sql, askserieVideoId).QueryRow(&item) return }