package services

import "eta/eta_mini_crm_ht/models"

// GetMenuTreeRecursive 递归菜单树
func GetMenuTreeRecursive(list []*models.SysMenuItem, parentId int) []*models.SysMenuItem {
	res := make([]*models.SysMenuItem, 0)
	for _, v := range list {
		if v.ParentId == parentId {
			v.Children = GetMenuTreeRecursive(list, v.SysMenuId)
			res = append(res, v)
		}
	}
	return res
}
