|
|
|
@ -328,7 +328,7 @@ func GetAccount(ctx context.Context, req *game.AccountReq) (res *game.AccountRes |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if req.Account != "" { |
|
|
|
if req.Account != "" { |
|
|
|
query["AccountName"] = req.Account |
|
|
|
query["AccountName"] = bson.M{"$regex": req.Account} |
|
|
|
} |
|
|
|
} |
|
|
|
if req.Ident != "" { |
|
|
|
if req.Ident != "" { |
|
|
|
query["Identity"] = req.Ident |
|
|
|
query["Identity"] = req.Ident |
|
|
|
@ -336,9 +336,6 @@ func GetAccount(ctx context.Context, req *game.AccountReq) (res *game.AccountRes |
|
|
|
if req.Name != "" { |
|
|
|
if req.Name != "" { |
|
|
|
query["RealName"] = req.Name |
|
|
|
query["RealName"] = req.Name |
|
|
|
} |
|
|
|
} |
|
|
|
if req.Name != "" { |
|
|
|
|
|
|
|
query["RealName"] = req.Name |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if req.GmState != "" { |
|
|
|
if req.GmState != "" { |
|
|
|
gm, _ := strconv.Atoi(req.GmState) |
|
|
|
gm, _ := strconv.Atoi(req.GmState) |
|
|
|
query["AccountType"] = gm |
|
|
|
query["AccountType"] = gm |
|
|
|
@ -347,7 +344,7 @@ func GetAccount(ctx context.Context, req *game.AccountReq) (res *game.AccountRes |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
return nil, errors.New("不存在数据库!") |
|
|
|
return nil, errors.New("不存在数据库!") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.Println("query: ", gjson.MustEncodeString(query)) |
|
|
|
res = new(game.AccountRes) |
|
|
|
res = new(game.AccountRes) |
|
|
|
res.Total, err = mongo.Collection("Account").Find(ctx, query).Count() |
|
|
|
res.Total, err = mongo.Collection("Account").Find(ctx, query).Count() |
|
|
|
err = mongo.Collection("Account").Find(ctx, query).Skip((req.PageNum - 1) * req.PageSize).Limit(req.PageSize).All(&res.Accounts) |
|
|
|
err = mongo.Collection("Account").Find(ctx, query).Skip((req.PageNum - 1) * req.PageSize).Limit(req.PageSize).All(&res.Accounts) |
|
|
|
|