package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type CygxAskserieVideoHistoryRecord struct { Id int `orm:"column(id);pk"` AskserieVideoId int `description:"askserie_video_id"` UserId int `description:"用户ID"` CreateTime time.Time `description:"创建时间"` Mobile string `description:"手机号"` Email string `description:"邮箱"` CompanyId int `description:"公司id"` CompanyName string `description:"公司名称"` RealName string `description:"用户实际名称"` SellerName string `description:"所属销售"` RegisterPlatform int `description:"来源 1小程序,2:网页"` ModifyTime time.Time `description:"更新时间"` VideoDuration int `description:"播放时长"` } // 添加 func AddCygxAskserieVideoHistoryRecord(item *CygxAskserieVideoHistoryRecord) (err error) { o := orm.NewOrm() _, err = o.Insert(item) return } func UpdateAskserieVideoCounts(askserieVideoId int) (err error) { sql := `UPDATE cygx_askserie_video SET video_counts = video_counts+1 WHERE askserie_video_id = ? ` o := orm.NewOrm() _, err = o.Raw(sql, askserieVideoId).Exec() return }