|
@@ -20,10 +20,11 @@ type CygxActivityVoice struct {
|
|
|
|
|
|
// ActivityVoiceReq 音频数据
|
|
|
type CygxActivityVoiceReq struct {
|
|
|
- ActivityId int ` description:"活动ID"`
|
|
|
- Url string `description:"音频资源url地址"`
|
|
|
- Name string `description:"音频名称"`
|
|
|
- PlaySeconds int `description:"音频时长"`
|
|
|
+ ActivityId int ` description:"活动ID"`
|
|
|
+ ActivityVoiceId int ` description:"音频ID"`
|
|
|
+ Url string `description:"音频资源url地址"`
|
|
|
+ Name string `description:"音频名称"`
|
|
|
+ PlaySeconds int `description:"音频时长"`
|
|
|
}
|
|
|
|
|
|
// GetCygxActivityVoiceReqList 获取活动ID的音频
|
|
@@ -36,6 +37,7 @@ func GetCygxActivityVoiceReqList(activityIds []int) (items []*CygxActivityVoiceR
|
|
|
//endTime := time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05")
|
|
|
sql := `SELECT
|
|
|
v.activity_id,
|
|
|
+ v.activity_voice_id,
|
|
|
v.voice_url AS url,
|
|
|
v.voice_name AS name,
|
|
|
v.voice_play_seconds AS play_seconds
|
|
@@ -74,3 +76,10 @@ func GetActivityVoiceListAll(condition string, pars []interface{}, startSize, pa
|
|
|
_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetCygxActivityVoiceByActivityId 主键获取活动音频
|
|
|
+func GetCygxActivityVoiceByActivityId(activityId int) (item *CygxActivityVoice, err error) {
|
|
|
+ sql := `SELECT * FROM cygx_activity_voice WHERE activity_id = ? LIMIT 1`
|
|
|
+ err = orm.NewOrm().Raw(sql, activityId).QueryRow(&item)
|
|
|
+ return
|
|
|
+}
|