作者 庄敏学

排序

@@ -58,6 +58,7 @@ func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest @@ -58,6 +58,7 @@ func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest
58 break 58 break
59 } 59 }
60 } 60 }
  61 + if orderField != "" && orderBy != "" {
61 sort.Slice(response.Grid.List, func(i, j int) bool { 62 sort.Slice(response.Grid.List, func(i, j int) bool {
62 if _, ok := response.Grid.List[i][orderField]; ok { 63 if _, ok := response.Grid.List[i][orderField]; ok {
63 if _, ok := response.Grid.List[j][orderField]; ok { 64 if _, ok := response.Grid.List[j][orderField]; ok {
@@ -70,6 +71,7 @@ func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest @@ -70,6 +71,7 @@ func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest
70 } 71 }
71 return true 72 return true
72 }) 73 })
  74 + }
73 resp = map[string]interface{}{ 75 resp = map[string]interface{}{
74 "objectId": response.ObjectId, 76 "objectId": response.ObjectId,
75 "fields": removeIdField(response.Fields), 77 "fields": removeIdField(response.Fields),