|
@@ -65,7 +65,7 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
if len(pIds) > 0 {
|
|
|
//常用功能存储是三级菜单id,需要四级菜单信息也查出来
|
|
|
//会出现 用户设置常用功能,此功能下线,用户设置依然保存的有此功能 查询不能加 AND status = 0
|
|
|
- menuData := entity.BaseMysql.SelectBySql(fmt.Sprintf(`SELECT * from %s WHERE id IN (%s) OR (parentid IN (%s) AND status = 0)`, entity.WorkMenu, strings.Join(pIds, ","), strings.Join(pIds, ",")))
|
|
|
+ menuData := entity.BaseMysql.SelectBySql(fmt.Sprintf(`SELECT * from %s WHERE id IN (%s) OR (parentid IN (%s) AND status = 0) ORDER BY FIELD(id , %s);`, entity.WorkMenu, strings.Join(pIds, ","), strings.Join(pIds, ","), strings.Join(pIds, ",")))
|
|
|
if menuData != nil && len(*menuData) > 0 {
|
|
|
var (
|
|
|
m = &entity.WorkDesktopMenu{
|
|
@@ -80,14 +80,9 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
}
|
|
|
childMenus = map[int][]*entity.JYMenu{}
|
|
|
)
|
|
|
- //是否存在父级
|
|
|
- parentIsExists := map[int]bool{}
|
|
|
for _, mv := range *menuData {
|
|
|
- //id
|
|
|
- id := MC.IntAll(mv["id"])
|
|
|
//parentId
|
|
|
parentId := MC.IntAll(mv["parentid"])
|
|
|
- parentIsExists[id] = true
|
|
|
menu := &entity.JYMenu{
|
|
|
Id: MC.IntAll(mv["id"]),
|
|
|
Name: MC.ObjToString(mv["name"]),
|
|
@@ -103,6 +98,7 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
PermissionCode: MC.ObjToString(mv["permissioncode"]),
|
|
|
CapitalCode: MC.ObjToString(mv["capitalcode"]),
|
|
|
Authority: MC.IntAll(mv["authority"]),
|
|
|
+ Level: MC.IntAll(mv["level"]),
|
|
|
}
|
|
|
var OpenType = map[string]string{}
|
|
|
if err := json.Unmarshal([]byte(MC.ObjToString(mv["opentype"])), &OpenType); err == nil {
|
|
@@ -124,7 +120,7 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
menu.AdditionalInfo = additional
|
|
|
}
|
|
|
}
|
|
|
- if parentIsExists[parentId] {
|
|
|
+ if menu.Level == 4 {
|
|
|
childMenus[parentId] = append(childMenus[parentId], menu)
|
|
|
} else {
|
|
|
m.MenuTree = append(m.MenuTree, menu)
|
|
@@ -149,7 +145,7 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
|
|
|
r.ErrorCode = -1
|
|
|
r.ErrorMsg = "菜单模式-参数异常"
|
|
|
} else {
|
|
|
- menuModes := entity.BaseMysql.SelectBySql(`SELECT id,value FROM `+entity.WorkCommonly+` WHERE appid=? AND base_userid =? AND field = ? AND platform = ? LIMIT 1`, in.AppId, in.NewUserId, in.ActionMode, in.Platform)
|
|
|
+ menuModes := entity.BaseMysql.SelectBySql(`SELECT id,value FROM `+entity.WorkCommonly+` WHERE appid=? AND base_userid =? AND field = ? LIMIT 1`, in.AppId, in.NewUserId, in.ActionMode)
|
|
|
if menuModes != nil && len(*menuModes) > 0 {
|
|
|
menuMode := (*menuModes)[0]
|
|
|
if MC.ObjToString(menuMode["value"]) != in.MenuMode {
|