Skip to content

Commit

Permalink
🐛 修改排序问题
Browse files Browse the repository at this point in the history
  • Loading branch information
guohuiyuan committed Jun 5, 2024
1 parent 588d3b7 commit 5a524a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin/chatcount/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ func (a ByTotalTimeDescMessageDesc) Len() int {
return len(a)
}

// Less 实现 sort.Interface,按 TotalTime 降序,TotalMessage 降序
// Less 实现 sort.Interface,按 TodayTime 降序,TodayMessage 降序
func (a ByTotalTimeDescMessageDesc) Less(i, j int) bool {
if a[i].TotalTime == a[j].TotalTime {
return a[i].TotalMessage > a[j].TotalMessage
if a[i].TodayTime == a[j].TodayTime {
return a[i].TodayMessage > a[j].TodayMessage
}
return a[i].TotalTime > a[j].TotalTime
return a[i].TodayTime > a[j].TodayTime
}

// Swap 实现 sort.Interface
Expand Down

0 comments on commit 5a524a7

Please sign in to comment.