定义结构体
type sortSons struct {
	models.Sort
	Sons int
}查询数据,并通过range赋值
userList,_:=models.QuerySortList(&listsearch,(page-1)*pre_page,pre_page)
	var attrs = map[int]interface{}{}
	for i,v:=range userList{
		sonSearch:=models.ListSearch{ParentId:int(v.ID)}
		childrenCount,_:=models.QuerySortListCount(&sonSearch)
		attrs[i]=sortSons{Sort:*v,Sons:childrenCount}
	}主要实现是在attrs这句,其中Sort后面要用*。
目前的能力,不考虑效率,只考虑功能实现。