|
@@ -5,6 +5,9 @@ import (
|
|
|
"errors"
|
|
|
"log"
|
|
|
"math"
|
|
|
+ "os"
|
|
|
+ "sort"
|
|
|
+ "strconv"
|
|
|
"time"
|
|
|
|
|
|
"github.com/mhaya/game/game_cluster/internal/constant"
|
|
@@ -145,6 +148,22 @@ func (s *Synthesis) FindWithdrawal(req *entity.UserWithdrawalReq) ([]*entity.Use
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if req.Withdrawal != "" {
|
|
|
+ withdrawal, err := strconv.Atoi(req.Withdrawal)
|
|
|
+ if err != nil {
|
|
|
+ return nil, 0, os.ErrInvalid
|
|
|
+ }
|
|
|
+ filter["withdrawal"] = withdrawal
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.Address != "" {
|
|
|
+ filter["address"] = req.Address
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.Status != "" {
|
|
|
+ filter["status"] = req.Status
|
|
|
+ }
|
|
|
+
|
|
|
// 设置分页选项
|
|
|
findOptions := options.Find()
|
|
|
findOptions.SetSkip(int64((req.Page - 1) * req.Size))
|
|
@@ -411,10 +430,15 @@ func (s *Synthesis) FindUserLevel() ([]*entity.UserLevelCountResp, error) {
|
|
|
dataMap[key] += v1
|
|
|
}
|
|
|
}
|
|
|
- for k, v := range dataMap {
|
|
|
+ keys := make([]string, 0, len(dataMap))
|
|
|
+ for k := range dataMap {
|
|
|
+ keys = append(keys, k)
|
|
|
+ }
|
|
|
+ sort.Strings(keys)
|
|
|
+ for _, v := range keys {
|
|
|
results = append(results, &entity.UserLevelCountResp{
|
|
|
- Level: cast.ToInt(k),
|
|
|
- UserCount: v,
|
|
|
+ Level: cast.ToInt(v),
|
|
|
+ UserCount: dataMap[v],
|
|
|
})
|
|
|
}
|
|
|
|