query.go 787 B

123456789101112131415161718192021222324
  1. package voice_section
  2. import (
  3. "hongze/hongze_yb/global"
  4. "hongze/hongze_yb/models/tables/voice_broadcast"
  5. )
  6. // GetVoiceSection 查询所有语音播报章节
  7. func GetVoiceSection() (list []*VoiceSection, err error) {
  8. err = global.DEFAULT_MYSQL.Order("create_time").Find(&list).Error
  9. return
  10. }
  11. // GetVoiceSection 查询所有语音播报章节
  12. func GetVoiceVariety() (list []*VoiceSection, err error) {
  13. err = global.DEFAULT_MYSQL.Group("variety_id").Order("create_time").Find(&list).Error
  14. return
  15. }
  16. // GetVoiceSectionFromBroadcast 查询所有语音播报章节
  17. func GetVoiceSectionFromBroadcast(bannedIds []int) (list []*voice_broadcast.VoiceBroadcast, err error) {
  18. err = global.DEFAULT_MYSQL.Where("section_id IN (?)", bannedIds).Group("section_id").Find(&list).Error
  19. return
  20. }