Compare commits
2 Commits
feature/fz
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
91a29e441d | |
|
|
777f86b152 |
|
|
@ -368,7 +368,13 @@ func (b *BbxtTools) GetProfitRankingSum(now time.Time) (report *ReportRes, err e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(data.List) == 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
maxLen := 20
|
||||||
|
if len(data.List) < maxLen {
|
||||||
|
maxLen = len(data.List)
|
||||||
|
}
|
||||||
//排序
|
//排序
|
||||||
sort.Slice(data.List, func(i, j int) bool {
|
sort.Slice(data.List, func(i, j int) bool {
|
||||||
return data.List[i].HistoryOneDiff > data.List[j].HistoryOneDiff
|
return data.List[i].HistoryOneDiff > data.List[j].HistoryOneDiff
|
||||||
|
|
@ -376,7 +382,7 @@ func (b *BbxtTools) GetProfitRankingSum(now time.Time) (report *ReportRes, err e
|
||||||
//取前20和后20
|
//取前20和后20
|
||||||
var (
|
var (
|
||||||
total [][]string
|
total [][]string
|
||||||
top = data.List[:20]
|
top = data.List[:maxLen]
|
||||||
bottom = data.List[len(data.List)-20:]
|
bottom = data.List[len(data.List)-20:]
|
||||||
)
|
)
|
||||||
//合并前20和后20
|
//合并前20和后20
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue