package yb import ( "github.com/beego/beego/v2/client/orm" "hongze/hz_crm_api/utils" ) type VoiceBroadcast struct { BroadcastId int `gorm:"primaryKey;column:broadcast_id;type:int(11)" description:"语音ID"` BroadcastName string `description:"语音名称"` SectionId int `description:"语音分类ID"` SectionName string `description:"语音分类名称"` VarietyId int `description:"品种id"` VarietyName string `description:"品种名称"` AuthorId int `description:"作者id"` Author string `description:"作者"` ImgUrl string `description:"背景图url"` VoiceUrl string `description:"音频url"` VoicePlaySeconds string `description:"音频时长"` VoiceSize string `description:"音频大小"` CreateTime string `description:"创建时间"` } // TableName get sql table name.获取数据库表名 func (m *VoiceBroadcast) TableName() string { return "yb_voice_broadcast" } func UpdateVoiceBroadcast(sectionId int, imgUrl string) { var err error defer func() { if err != nil { utils.FileLog.Info("UpdateVoiceBroadcast err: ", err) } }() o := orm.NewOrm() sql := "UPDATE yb_voice_broadcast SET img_url=? WHERE section_id=? " _, err = o.Raw(sql, imgUrl, sectionId).Exec() return }