package models import ( "rdluck_tools/orm" "time" ) type Banner struct { Id int `orm:"column(id);pk"` ClassifyId int `description:"分类id"` ImageUrl string `description:"图片路径"` BannerType int `description:"类型 1:轮播图,2:头部海报"` CreateTime time.Time `description:"创建时间"` ModifyTime time.Time `description:"修改时间"` ClassifyName string `description:"分类名称"` JumpUrl string `description:"跳转地址"` } //获取轮播图列表 func GetHomeBannerList() (items []*Banner, err error) { sql := ` SELECT * FROM banner WHERE banner_type=1 ORDER BY modify_time DESC ` o := orm.NewOrm() o.Using("rddp") _, err = o.Raw(sql).QueryRows(&items) return }