Ver Fonte

Merge branch 'master' of 192.168.30.132:MTP2.0/MTP20_IF

zou.yingbin há 4 anos atrás
pai
commit
6fc3b1e837
1 ficheiros alterados com 10 adições e 7 exclusões
  1. 10 7
      models/ermcpAccMgr.go

+ 10 - 7
models/ermcpAccMgr.go

@@ -607,7 +607,7 @@ func (r *ErmcpRoleMenu) GetDataEx() (interface{}, error) {
 		"       f.remark" +
 		" from funcmenulist f" +
 		" where f.menutype = 3"
-	err := db.GetEngine().SQL(sql).Find(&sData)
+	db.GetEngine().SQL(sql).Find(&sData)
 	// 先创建PARENTCODE为空的记录
 	for _, v := range sData {
 		if v.PARENTCODE == "" {
@@ -621,12 +621,15 @@ func (r *ErmcpRoleMenu) GetDataEx() (interface{}, error) {
 	}
 
 	// 获取有权限的菜单
-	rData := make([]ErmcpRoleMenu, 0)
-	err = db.GetEngine().SQL(r.buildSql()).Find(&rData)
-	// 判断权限
-	for i := range sDataEx {
-		s := &sDataEx[i]
-		s.setRold(rData)
+	var err error
+	if len(r.FilterRoleId) > 0 {
+		rData := make([]ErmcpRoleMenu, 0)
+		err = db.GetEngine().SQL(r.buildSql()).Find(&rData)
+		// 判断权限
+		for i := range sDataEx {
+			s := &sDataEx[i]
+			s.setRold(rData)
+		}
 	}
 
 	return sDataEx, err