mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-09-28 13:02:16 +08:00
重要:更新TsTime,excel2导出不使用tag
This commit is contained in:
@@ -2,10 +2,10 @@ package util
|
||||
|
||||
var ArrayUtil = arrayUtil{}
|
||||
|
||||
//arrayUtil 数组工具类
|
||||
// arrayUtil 数组工具类
|
||||
type arrayUtil struct{}
|
||||
|
||||
//ListToTree 字典列表转树形结构
|
||||
// ListToTree 字典列表转树形结构
|
||||
func (au arrayUtil) ListToTree(arr []map[string]interface{}, id string, pid string, child string) (mapList []interface{}) {
|
||||
mapList = []interface{}{}
|
||||
// 遍历以id_为key生成map
|
||||
@@ -29,6 +29,10 @@ func (au arrayUtil) ListToTree(arr []map[string]interface{}, id string, pid stri
|
||||
}
|
||||
pNode.(map[string]interface{})[child] = cVal
|
||||
continue
|
||||
} else {
|
||||
cVal := []interface{}{m}
|
||||
pNode.(map[string]interface{})[child] = cVal
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user