model.go 387 B

12345678910111213
  1. package yb_research_banner
  2. import "hongze/hongze_yb/global"
  3. func (item *YbResearchBanner) Create() (err error) {
  4. err = global.DEFAULT_MYSQL.Create(item).Error
  5. return
  6. }
  7. func (m *YbResearchBanner) Fetch(userId, bannerId int) (item *YbResearchBanner, err error) {
  8. err = global.DEFAULT_MYSQL.Model(m).Where("user_id = ? and banner_id= ?", userId, bannerId).First(&item).Error
  9. return
  10. }