user_chart_permission_mapping.go 524 B

12345678910111213141516
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type UserChartPermissionMapping struct {
  4. UserChartPermissionMappingId int `orm:"pk" description:"id"`
  5. UserId int `description:"用户id"`
  6. ChartPermissionId int `description:"品种id"`
  7. }
  8. func GetChartPermissionIdByUserId(UserId int) (items []int, err error) {
  9. o := orm.NewOrm()
  10. sql := `SELECT chart_permission_id FROM user_chart_permission_mapping WHERE user_id=?`
  11. _, err = o.Raw(sql, UserId).QueryRows(&items)
  12. return
  13. }