chart_permission.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ChartPermission 报告权限表
  7. type ChartPermission struct {
  8. ChartPermissionId int `orm:"column(chart_permission_id);pk" description:"问题ID"`
  9. ChartPermissionName string `description:"名称"`
  10. PermissionName string `description:"权限名"`
  11. Sort int `description:"排序"`
  12. Enabled int `description:"是否可用"`
  13. CreatedTime time.Time `description:"创建时间"`
  14. LastUpdatedTime time.Time `description:"更新时间"`
  15. TeleconferenceSort int `description:"电话会类型排序"`
  16. Remark string `description:"备注"`
  17. ClassifyName string `description:"分类名称"`
  18. ProductName string `description:"产品名称"`
  19. ProductId int `description:"产品ID"`
  20. ImageURL string `description:"图片地址"`
  21. ShowType int `description:"1:查研观向小程序展示"`
  22. IsOther int `description:"是否是其他,用于查研观向小程序后台展示"`
  23. IsReport int `description:"是否是报告,用于查研观向小程序前台报告展示"`
  24. CygxAuth int `description:"是否是权限,用于查研观向小程序前台权限校验"`
  25. YbImgUrl string `description:"研报小程序报告列表icon"`
  26. PriceDrivenState int `description:"品种价格驱动开启状态 0-关闭 1-开启"`
  27. }
  28. // Update 更新
  29. func (chartPermissionInfo *ChartPermission) Update(cols []string) (err error) {
  30. o := orm.NewOrmUsingDB("weekly")
  31. _, err = o.Update(chartPermissionInfo, cols...)
  32. return
  33. }
  34. // GetChartPermissionList 获取品种权限列表
  35. func GetChartPermissionList() (list []*ChartPermission, err error) {
  36. o := orm.NewOrmUsingDB("weekly")
  37. sql := `SELECT * FROM chart_permission ORDER BY product_id ASC, sort ASC`
  38. _, err = o.Raw(sql).QueryRows(&list)
  39. return
  40. }