Sfoglia il codice sorgente

修改PC端获取菜单接口BUG

Zhou.xiaoning 4 anni fa
parent
commit
5287faf091
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      models/common.go

+ 5 - 1
models/common.go

@@ -849,7 +849,11 @@ func GetErmcpRoleFuncMenuLists(loginID int, resourceCode string) ([]Funcmenulist
 
 	if userAccount.Usertype == 5 || (userAccount.Usertype == 2 && isTrader) {
 		// 交易所,自营会员及投资者的权限不进行判断
-		if err := db.GetEngine().SQL("select F.* from FUNCMENULIST F where F.MENUTYPE = 4").Find(&funcMenuLists); err != nil {
+		sql := "select F.* from FUNCMENULIST F where F.MENUTYPE = 4"
+		if len(resourceCode) != 0 {
+			sql += fmt.Sprintf(" and F.RESOURCECODE = '%s'", resourceCode)
+		}
+		if err := db.GetEngine().SQL(sql).Find(&funcMenuLists); err != nil {
 			return nil, err
 		}
 	} else {