activity_share_img.go 996 B

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