初始化充值金额
This commit is contained in:
parent
8c843ecf0b
commit
3c910a4ad7
|
|
@ -114,8 +114,8 @@ func GetMoneyTotal(platform string, snid int32) int64 {
|
|||
}
|
||||
tc := new(m)
|
||||
err = c.Pipe([]bson.M{
|
||||
{"$match": bson.M{"snid": snid, "state": 1, "consumenum": bson.M{"$gt": 0}}},
|
||||
{"$group": bson.M{"_id": nil, "total": bson.M{"$sum": "$consumenum"}}},
|
||||
{"$match": bson.M{"snid": snid, "state": 1, "consumetypenum": bson.M{"$gt": 0}}},
|
||||
{"$group": bson.M{"_id": nil, "total": bson.M{"$sum": "$consumetypenum"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("GetMoneyTotal error:", err)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
swapN = tc.Count
|
||||
|
||||
// 比赛返回
|
||||
tc = new(m)
|
||||
err = c.Pipe([]bson.M{
|
||||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_MatchSignup}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
|
|
@ -84,6 +85,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
matchN = tc.Count
|
||||
|
||||
// 消耗总数量
|
||||
tc = new(m)
|
||||
err = c.Pipe([]bson.M{
|
||||
{"$match": bson.M{"snid": snid, "logtype": 1, "itemid": id}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
|
|
@ -95,6 +97,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
costN = tc.Count
|
||||
|
||||
// 获得总数量
|
||||
tc = new(m)
|
||||
err = c.Pipe([]bson.M{
|
||||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
|
|
|
|||
Loading…
Reference in New Issue