|
@@ -413,6 +413,50 @@ func (s *Synthesis) FindMDBUserLogDaily(req entity.UserLogDailyReq) (*entity.Use
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
+// FindUserLogTotal 查询总提现数量,总注册人数,
|
|
|
+func (s *Synthesis) FindMDBUserLogTotal() (*entity.UserLogTotalResp, error) {
|
|
|
+ collection := mdb.MDB.Collection(constant.CNamePlayerDailyRecord)
|
|
|
+
|
|
|
+ ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
|
|
|
+ defer cancel()
|
|
|
+
|
|
|
+ filter := bson.M{}
|
|
|
+ filter["daily"] = bson.M{
|
|
|
+ "$gte": 0,
|
|
|
+ }
|
|
|
+
|
|
|
+ cursor, err := collection.Find(ctx, filter, nil)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ defer cursor.Close(ctx)
|
|
|
+
|
|
|
+ // 解析查询结果
|
|
|
+ var results []entity.UserLogDailyDetail
|
|
|
+
|
|
|
+ for cursor.Next(ctx) {
|
|
|
+ var result entity.UserLogDailyDetail
|
|
|
+ err := cursor.Decode(&result)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ results = append(results, result)
|
|
|
+ }
|
|
|
+
|
|
|
+ registerCount := 0
|
|
|
+ var uCashoutCount float64
|
|
|
+
|
|
|
+ for _, v := range results {
|
|
|
+ registerCount += v.Registered
|
|
|
+ uCashoutCount += v.UCashout
|
|
|
+ }
|
|
|
+
|
|
|
+ return &entity.UserLogTotalResp{
|
|
|
+ Registered: registerCount,
|
|
|
+ UCashout: uCashoutCount,
|
|
|
+ }, nil
|
|
|
+}
|
|
|
+
|
|
|
// FindWithdrawal 根据请求查询提现记录
|
|
|
func (s *Synthesis) FindWithdrawal(req entity.UserWithdrawalReq) (*entity.UserWithdrawalResp, *code.Result) {
|
|
|
page, pageSize := checkPageParam(req.Page, req.Size)
|