增加日志
This commit is contained in:
parent
f2c63ce427
commit
68ca6af923
|
|
@ -1,6 +1,7 @@
|
|||
package svc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/game/dbproxy/mongo"
|
||||
|
|
@ -116,7 +117,7 @@ func GetMoneyTotal(platform string, snid int32) int64 {
|
|||
{"$match": bson.M{"snid": snid, "state": 1, "consumenum": bson.M{"$gt": 0}}},
|
||||
{"$group": bson.M{"_id": nil, "total": bson.M{"$sum": "$consumenum"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("GetMoneyTotal error:", err)
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package svc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/rpc"
|
||||
|
||||
"github.com/globalsign/mgo"
|
||||
|
|
@ -65,7 +66,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_Exchange}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Warn("GetItemCount swapN error:", err)
|
||||
return 0
|
||||
}
|
||||
|
|
@ -76,7 +77,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_MatchSignup}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Warn("GetItemCount matchN error:", err)
|
||||
return 0
|
||||
}
|
||||
|
|
@ -87,7 +88,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
{"$match": bson.M{"snid": snid, "logtype": 1, "itemid": id}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Warn("GetItemCount costN error:", err)
|
||||
return 0
|
||||
}
|
||||
|
|
@ -98,7 +99,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
|||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id}},
|
||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||
}).AllowDiskUse().One(tc)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Warn("GetItemCount gainN error:", err)
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,6 +328,10 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
|||
return nil
|
||||
}
|
||||
|
||||
defer func() {
|
||||
logger.Logger.Debugf("Player Data: snid:%v VCardCost:%v MoneyTotal:%v", ret.Pd.SnId, ret.Pd.VCardCost, ret.Pd.MoneyTotal)
|
||||
}()
|
||||
|
||||
f := func(p *model.PlayerData) {
|
||||
// 更新一下绑定关系
|
||||
if p.PSnId > 0 && p.PCode != "" {
|
||||
|
|
@ -410,7 +414,6 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
|||
if args.CorrectData && ret.Pd != nil {
|
||||
CorrectData(ret.Pd)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue