|
@@ -7,6 +7,7 @@ import (
|
|
|
"eta/eta_index_lib/services"
|
|
|
"eta/eta_index_lib/utils"
|
|
|
"fmt"
|
|
|
+ "sort"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
@@ -64,6 +65,17 @@ func (this *KplerController) GetData() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ for _, index := range indexes {
|
|
|
+ //根据日期的值倒序
|
|
|
+ sort.Slice(index.IndexData, func(i, j int) bool {
|
|
|
+ return index.IndexData[i].DataTime > index.IndexData[j].DataTime
|
|
|
+ })
|
|
|
+ //只显示10条数据
|
|
|
+ if len(index.IndexData) > 10 {
|
|
|
+ index.IndexData = index.IndexData[:10]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
br.Data = indexes
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|