1234567891011121314151617181920212223 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- type CygxActivityShareImgResp struct {
- Id int `description:"主键ID"`
- ActivityTypeId int `description:"活动类型ID,默认值为0"`
- ActivityTypeName string `description:"活动类型名称"`
- ChartPermissionId int `description:"表chart_permission中的ID,默认值为0"`
- ChartPermissionName string `description:"行业名称"`
- City string `description:"城市"`
- Img string `description:"图片地址"`
- }
- // 根据活动类型,行业或者城市,获取对应的封面图片
- func CygxActivityShareImgDetail(activityTypeId, chartPermissionId int, city string) (item *CygxActivityShareImgResp, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM cygx_activity_share_img WHERE activity_type_id = ? AND (chart_permission_id = ? OR city = ? ) LIMIT 1 `
- err = o.Raw(sql, activityTypeId, chartPermissionId, city).QueryRow(&item)
- return
- }
|