Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop

This commit is contained in:
sk 2024-09-27 18:03:35 +08:00
commit 69a2ecad41
1 changed files with 21 additions and 6 deletions

View File

@ -116,15 +116,30 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes)
}
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) {
//itemTypeIds := []int32{common.GainWayClawdollCostItem, common.GainWayItemShopChangeDoll}
var sql []bson.M
cond := bson.M{"snid": args.Snid, "typeid": bson.M{"$in": args.TypeIds}}
c := ItemLogsCollection(args.Platform)
if c == nil {
return
var Logs []model.RetClawdollItemLog
for _, typeId := range args.TypeIds {
sql = append(sql, bson.M{"snid": args.Snid, "typeid": typeId})
switch typeId {
case common.GainWay_Shop_Buy: // 商城兑换
sql = append(sql, bson.M{"itemid": common.ItemIDClawdoll})
case common.GainWayItemShopChangeDoll: // 积分支出
sql = append(sql, bson.M{"itemid": common.ItemDollCard})
case common.GainWayItemFenGain: // 积分获取
sql = append(sql, bson.M{"itemid": common.ItemDollCard})
}
c := ItemLogsCollection(args.Platform)
if c == nil {
return
}
err = c.Find(bson.M{"$and": sql}).Select(bson.M{"itemid": 1, "createts": 1, "typeid": 1, "count": 1, "logtype": 1}).All(&Logs)
}
err = c.Find(cond).Select(bson.M{"itemid": 1, "createts": 1, "typeid": 1, "count": 1, "logtype": 1}).All(&ret.Logs)
ret.Logs = Logs
return
}