|
@ -262,3 +262,17 @@ func MapSort(order, val, val_type string, MapDate []map[string]interface{}) ([]m |
|
|
} |
|
|
} |
|
|
return res, nil |
|
|
return res, nil |
|
|
} |
|
|
} |
|
|
|
|
|
func MapPage(pageNum, pageSize int, MapDate []map[string]interface{}) []map[string]interface{} { |
|
|
|
|
|
list := []map[string]interface{}{} |
|
|
|
|
|
stat := (pageNum - 1) * pageSize |
|
|
|
|
|
end := stat + pageSize - 1 |
|
|
|
|
|
for k, v := range MapDate { |
|
|
|
|
|
if k >= stat && k <= end { |
|
|
|
|
|
list = append(list, v) |
|
|
|
|
|
} |
|
|
|
|
|
if k > end { |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return list |
|
|
|
|
|
} |