model.go 527 B

123456789101112131415161718
  1. package yb_community_video_play_log
  2. import "hongze/hongze_yb/global"
  3. func (item *YbCommunityVideoPlayLog) Create() (err error) {
  4. err = global.DEFAULT_MYSQL.Create(item).Error
  5. return
  6. }
  7. func (l *YbCommunityVideoPlayLog) GetById() (item *YbCommunityVideoPlayLog, err error) {
  8. err = global.DEFAULT_MYSQL.Model(l).Where("id = ?", l.ID).First(&item).Error
  9. return
  10. }
  11. func (l *YbCommunityVideoPlayLog) Update(updateCols []string) (err error) {
  12. err = global.DEFAULT_MYSQL.Model(l).Select(updateCols).Updates(*l).Error
  13. return
  14. }