mirror of
				https://github.com/bufanyun/hotgo.git
				synced 2025-11-04 16:23:43 +08:00 
			
		
		
		
	fix: 修复数据树为空时,无法显示的问题
This commit is contained in:
		@@ -13,6 +13,9 @@ type Node interface {
 | 
			
		||||
 | 
			
		||||
// ListToTree 根据上下级关系将列表数据转为树状数据
 | 
			
		||||
func ListToTree(pid int64, nodes []Node) (list []Node, err error) {
 | 
			
		||||
	if len(nodes) == 0 {
 | 
			
		||||
		return nodes, nil
 | 
			
		||||
	}
 | 
			
		||||
	for _, v := range nodes {
 | 
			
		||||
		if v.PID() == pid {
 | 
			
		||||
			item := v
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user