123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- type CygxBannerResp struct {
- BannerId int `description:"BannerId等于0新增,大于零修改"`
- ImgId int `description:"cygx_banner_img主键ID"`
- IndexImg string `description:"小程序封面图"`
- ListType string `description:"ABC哪一列"`
- Title string `description:"标题"`
- Link string `description:"链接地址"`
- Subtitle string `description:"副标题"`
- BannerUrlResp *BannerUrlResp `description:"跳转地址"`
- }
- type CygxBannerIdReq struct {
- BannerId int `description:"BannerId"`
- }
- type GetCygxBannerImgRespDetailResp struct {
- Detail *CygxBannerResp
- }
- // 通过ID获取详情
- func GetCygxBannerDetail(banneId int) (item *CygxBannerResp, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_banner WHERE banner_id=? `
- err = o.Raw(sql, banneId).QueryRow(&item)
- return
- }
- // 获取数量
- func GetCygxBannerCount(condition string, pars []interface{}) (count int, err error) {
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_banner as art WHERE 1= 1 `
- if condition != "" {
- sqlCount += condition
- }
- o := orm.NewOrm()
- err = o.Raw(sqlCount, pars).QueryRow(&count)
- return
- }
- // 列表
- func GetCygxBannerList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxBannerResp, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_banner as art WHERE 1= 1 `
- if condition != "" {
- sql += condition
- }
- sql += ` LIMIT ?,? `
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
- return
- }
- type CygxBannerListResp struct {
- ListA []*CygxBannerResp
- ListB []*CygxBannerResp
- ListC []*CygxBannerResp
- }
- type CygxBannerImgResp struct {
- ImgId int `description:"图片ID"`
- IndexImg string `description:"小程序封面图"`
- Img1 string `description:"图片1"`
- Img2 string `description:"图片2"`
- Img3 string `description:"图片3"`
- Img4 string `description:"图片4"`
- }
- type BannerUrlResp struct {
- ChartPermissionId int `description:"行业id"`
- SourceId int `description:"资源ID"`
- Type int `description:"类型:1普通文本,2:文章、3:活动、4:产业、5:关于我们"`
- Body string `description:"内容"`
- }
- type BannerUrlYxResp struct {
- IndexImg string `description:"小程序封面图"`
- Path string `description:"小程序路径"`
- }
- type BannerUrlYxListResp struct {
- ListA []*BannerUrlYxResp
- ListB []*BannerUrlYxResp
- ListC []*BannerUrlYxResp
- }
- // 列表
- func GetCygxBannerImgList() (items []*CygxBannerImgResp, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_banner_img as art WHERE 1= 1 `
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
|