From 7491a1d8346df78afb72bd322b34d196ca1f2d01 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 8 Dec 2020 01:08:21 +0800 Subject: [PATCH] modify sort method of account list --- pkg/models/account.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/models/account.go b/pkg/models/account.go index 7bd5af9f..05cced9c 100644 --- a/pkg/models/account.go +++ b/pkg/models/account.go @@ -154,5 +154,9 @@ func (a AccountInfoResponseSlice) Swap(i, j int) { } func (a AccountInfoResponseSlice) Less(i, j int) bool { + if a[i].Category != a[j].Category { + return a[i].Category < a[j].Category + } + return a[i].DisplayOrder < a[j].DisplayOrder }