|
@@ -273,6 +273,7 @@ type PermissionVarietyResp struct {
|
|
|
|
|
|
type PermissionVarietyItem struct {
|
|
type PermissionVarietyItem struct {
|
|
ChartPermissionId int `description:"权限id"`
|
|
ChartPermissionId int `description:"权限id"`
|
|
|
|
+ ParentId int `description:"父级权限id"`
|
|
ClassifyName string `orm:"column(permission_name)" description:"权限名称"`
|
|
ClassifyName string `orm:"column(permission_name)" description:"权限名称"`
|
|
}
|
|
}
|
|
|
|
|
|
@@ -282,6 +283,7 @@ type PermissionVarietyList struct {
|
|
Items []*PermissionVarietyItem
|
|
Items []*PermissionVarietyItem
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// todo 删除品种列表
|
|
func GetPermissionVarietyItems(productId int, classifyName string) (items []*PermissionVarietyItem, err error) {
|
|
func GetPermissionVarietyItems(productId int, classifyName string) (items []*PermissionVarietyItem, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
sql := ` SELECT * FROM chart_permission WHERE enabled=1 AND product_id=? AND classify_name=? GROUP BY permission_name ORDER BY sort ASC `
|
|
sql := ` SELECT * FROM chart_permission WHERE enabled=1 AND product_id=? AND classify_name=? GROUP BY permission_name ORDER BY sort ASC `
|
|
@@ -289,6 +291,13 @@ func GetPermissionVarietyItems(productId int, classifyName string) (items []*Per
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func GetPermissionVarietyItemsByProductId(productId int) (items []*PermissionVarietyItem, err error) {
|
|
|
|
+ o := orm.NewOrm()
|
|
|
|
+ sql := ` SELECT * FROM chart_permission WHERE enabled=1 AND product_id=? GROUP BY permission_name ORDER BY sort ASC `
|
|
|
|
+ _, err = o.Raw(sql, productId).QueryRows(&items)
|
|
|
|
+ return
|
|
|
|
+}
|
|
|
|
+
|
|
func GetCompanyReportPermission(companyId, productId int) (items []*CompanyReportPermission, err error) {
|
|
func GetCompanyReportPermission(companyId, productId int) (items []*CompanyReportPermission, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
sql := `SELECT * FROM company_report_permission WHERE company_id=? AND product_id=? `
|
|
sql := `SELECT * FROM company_report_permission WHERE company_id=? AND product_id=? `
|