| | |
| | | if params.PageInfo.Check() { |
| | | search.SetPage(params.Page, params.PageSize) |
| | | } |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetType(params.Type).SetJointName(params.JointName).SetOrder("created_at desc").Find() |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetType(params.Type).SetJointName(params.JointName). |
| | | SetIsScrapLocation(params.IsScrapLocation).SetOrder("created_at desc").Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查找失败") |
| | | return |
| | |
| | | if location.ParentId == 0 { |
| | | tree = append(tree, location) |
| | | } else { |
| | | if _, ok := m[location.ParentId]; !ok { |
| | | tree = append(tree, location) |
| | | continue |
| | | } |
| | | m[location.ParentId].Children = make([]*models.Location, 0) |
| | | m[location.ParentId].Children = append(m[location.ParentId].Children, location) |
| | | } |
| | | } |