1234567891011121314151617181920212223 |
- package models
- import "github.com/beego/beego/v2/client/orm"
- type UserChartPermissionMapping struct {
- UserChartPermissionMappingId int `orm:"pk" description:"id"`
- UserId int `description:"用户id"`
- ChartPermissionId int `description:"品种id"`
- }
- func GetChartPermissionIdByUserId(UserId int) (items []int, err error) {
- o := orm.NewOrm()
- sql := `SELECT chart_permission_id FROM user_chart_permission_mapping WHERE user_id=?`
- _, err = o.Raw(sql, UserId).QueryRows(&items)
- return
- }
- func GetUserChartPermissionMapping() (items []*UserChartPermissionMapping, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM user_chart_permission_mapping`
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
|