create.go 625 B

12345678910111213141516171819
  1. package voice_broadcast_statistics
  2. import "hongze/hongze_yb/global"
  3. // AddBroadcastStatistics 新增记录
  4. func (voiceBroadcastStatistics *VoiceBroadcastStatistics) AddBroadcastStatistics() (err error) {
  5. err = global.DEFAULT_MYSQL.Create(voiceBroadcastStatistics).Error
  6. return
  7. }
  8. func (l *VoiceBroadcastStatistics) GetById() (item *VoiceBroadcastStatistics, err error) {
  9. err = global.DEFAULT_MYSQL.Model(l).Where("id = ?", l.Id).First(&item).Error
  10. return
  11. }
  12. func (l *VoiceBroadcastStatistics) Update(updateCols []string) (err error) {
  13. err = global.DEFAULT_MYSQL.Model(l).Select(updateCols).Updates(*l).Error
  14. return
  15. }