banner.go 605 B

1234567891011121314151617181920212223
  1. package models
  2. import (
  3. "time"
  4. "github.com/beego/beego/v2/client/orm"
  5. )
  6. type Banner struct {
  7. BannerId int `orm:"pk" description:"id"`
  8. ImageUrl string `description:"图片地址"`
  9. CreateTime time.Time `description:"创建时间"`
  10. ModifyTime time.Time `description:"修改时间"`
  11. JumpUrl string `description:"跳转路径"`
  12. Remake string `description:"备注"`
  13. }
  14. func GetBannerList(startSize, pageSize int) (items []*Banner, err error) {
  15. o := orm.NewOrm()
  16. sql := `SELECT * FROM banner LIMIT ?,?`
  17. _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
  18. return
  19. }