model.go 519 B

123456789101112131415161718192021
  1. package yb_bullet_chat
  2. import "hongze/hongze_yb/global"
  3. func (m *YbBulletChat) Create() (err error) {
  4. err = global.DEFAULT_MYSQL.Create(m).Error
  5. return
  6. }
  7. func (m *YbBulletChat) Update(cols string) (err error) {
  8. err = global.DEFAULT_MYSQL.Model(m).Select(cols).Updates(*m).Error
  9. return
  10. }
  11. func GetList(condition string, pars []interface{}) (list []*YbBulletChat, err error) {
  12. err = global.DEFAULT_MYSQL.Model(YbBulletChat{}).
  13. Where(condition, pars...).
  14. Where("is_deleted = 0").
  15. Scan(&list).Error
  16. return
  17. }