package yb_bullet_chat

import "hongze/hongze_yb/global"

func (m *YbBulletChat) Create() (err error) {
	err = global.DEFAULT_MYSQL.Create(m).Error
	return
}

func (m *YbBulletChat) Update(cols string) (err error) {
	err = global.DEFAULT_MYSQL.Model(m).Select(cols).Updates(*m).Error
	return
}

func GetList(condition string, pars []interface{}) (list []*YbBulletChat, err error) {
	err = global.DEFAULT_MYSQL.Model(YbBulletChat{}).
		Where(condition, pars...).
		Where("is_deleted = 0").
		Scan(&list).Error
	return
}