Explorar o código

Merge branch 'cygx/cygx_14-5' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

zhangchuanxing hai 5 días
pai
achega
e37febf3c9
Modificáronse 2 ficheiros con 10 adicións e 1 borrados
  1. 1 1
      controllers/company_apply.go
  2. 9 0
      models/company/company_permission.go

+ 1 - 1
controllers/company_apply.go

@@ -2015,7 +2015,7 @@ func (this *CompanyApplyController) ApplyContract() {
 		//pListType := new(company.PermissionSetListType)
 		//p.ClassifyName = name
 		//pListType.ClassifyName = v
-		items, err := company.GetPermissionLookItems(productId, name)
+		items, err := company.GetPermissionLookItems2(productId, name)
 		if err != nil {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取权限信息失败,Err:" + err.Error()

+ 9 - 0
models/company/company_permission.go

@@ -188,6 +188,8 @@ type PermissionLookItem struct {
 	Points             float64               `description:"研选扣点包点数"`
 	ParentId           int                   `description:"父级权限id"`
 	IsPublic           int                   `description:"是否是公有权限1:公有权限,0私有权限"`
+	ShowInput          bool                  `description:"是否包含输入框"`
+	ChartContent       string                `description:"权限申请时下面的框点数回显"`
 	Child              []*PermissionLookItem `description:"子权限"`
 }
 
@@ -199,6 +201,13 @@ func GetPermissionLookItems(productId int, classifyName string) (items []*Permis
 	return
 }
 
+func GetPermissionLookItems2(productId int, classifyName string) (items []*PermissionLookItem, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT * FROM chart_permission WHERE enabled=1 AND product_id=? AND classify_name=? AND parent_id>0 AND permission_type!=2 ORDER BY sort ASC `
+	_, err = o.Raw(sql, productId, classifyName).QueryRows(&items)
+	return
+}
+
 func GetPermissionLookItemsByProductId(productId int) (items []*PermissionLookItem, err error) {
 	o := orm.NewOrm()
 	sql := ` SELECT * FROM chart_permission WHERE enabled=1 AND product_id=? ORDER BY sort ASC `