aa
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func GetMenu(db *DaoDB, name string, level int, userID string) (menus []*model.Menu, err error) {
|
||||
func GetMenu(db *DaoDB, name string, level, menuType int, userID string) (menus []*model.Menu, err error) {
|
||||
sqlParams := []interface{}{}
|
||||
sql := `
|
||||
SELECT DISTINCT a.*
|
||||
@@ -29,6 +29,10 @@ func GetMenu(db *DaoDB, name string, level int, userID string) (menus []*model.M
|
||||
sql += " AND a.level = ?"
|
||||
sqlParams = append(sqlParams, level)
|
||||
}
|
||||
if menuType != 0 {
|
||||
sql += " AND a.type = ?"
|
||||
sqlParams = append(sqlParams, menuType)
|
||||
}
|
||||
sql += " ORDER BY a.id"
|
||||
err = GetRows(db, &menus, sql, sqlParams)
|
||||
return menus, err
|
||||
|
||||
Reference in New Issue
Block a user