diff --git a/data/DB_GameItem.dat b/data/DB_GameItem.dat index f49b1b2..8f1263e 100644 Binary files a/data/DB_GameItem.dat and b/data/DB_GameItem.dat differ diff --git a/data/DB_GameItem.json b/data/DB_GameItem.json index 8c618d7..c4a31fe 100644 --- a/data/DB_GameItem.json +++ b/data/DB_GameItem.json @@ -2512,8 +2512,8 @@ 1 ], "Classify": [ - 0, - 0, + 1, + 1, 0 ], "Type": 17, @@ -2540,8 +2540,8 @@ 1 ], "Classify": [ - 0, - 0, + 1, + 1, 0 ], "Type": 17, @@ -2568,8 +2568,8 @@ 1 ], "Classify": [ - 0, - 0, + 1, + 1, 0 ], "Type": 17, @@ -2596,8 +2596,8 @@ 1 ], "Classify": [ - 0, - 0, + 1, + 1, 0 ], "Type": 17, diff --git a/data/DB_GiftCard.dat b/data/DB_GiftCard.dat index 96640b0..1560036 100644 Binary files a/data/DB_GiftCard.dat and b/data/DB_GiftCard.dat differ diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index 3360a32..6359cb0 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 930f0e7..7ae1e8d 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/dbproxy/svc/l_dbshoplog.go b/dbproxy/svc/l_dbshoplog.go index 19c6ad7..aade343 100644 --- a/dbproxy/svc/l_dbshoplog.go +++ b/dbproxy/svc/l_dbshoplog.go @@ -18,6 +18,8 @@ func DbShopLogCollection(plt string) *mongo.Collection { dbShopRec.EnsureIndex(mgo.Index{Key: []string{"pageid"}, Background: true, Sparse: true}) dbShopRec.EnsureIndex(mgo.Index{Key: []string{"state"}, Background: true, Sparse: true}) dbShopRec.EnsureIndex(mgo.Index{Key: []string{"shopid"}, Background: true, Sparse: true}) + dbShopRec.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) + dbShopRec.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true}) } return dbShopRec } diff --git a/public b/public index b3c639b..5843874 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit b3c639ba6fbdb6ee41e21a8b96901a179db031af +Subproject commit 58438743032d93fc2e16d705c4ebe1df5c33f1b2 diff --git a/worldsrv/player.go b/worldsrv/player.go index ad3a894..3e51cad 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -3848,66 +3848,73 @@ func (this *Player) GetPayGoodsInfo() { if data != nil { infos := data.([]*model.DbShop) for _, info := range infos { - var itemInfo []*player_proto.PayItem - var items []*Item - if len(info.Amount) > 0 { - this.AddCoin(int64(info.Amount[0]), 0, info.GainWay, "Callback_login", info.Remark) - this.AddDiamond(int64(info.Amount[1]), 0, info.GainWay, "Callback_login", info.Remark) - } - this.AddMoneyPayTotal(int64(info.ConsumeNum)) - if info.ItemInfo != nil { - for _, v := range info.ItemInfo { - items = append(items, &Item{ItemId: v.ItemId, ItemNum: v.ItemNum}) - itemInfo = append(itemInfo, &player_proto.PayItem{ - ItemId: v.ItemId, - ItemNum: v.ItemNum, - }) + switch info.PageId { + case ShopPageBackend: + logger.Logger.Tracef("GetPayGoodsInfo ShopPageBackend %+v", *info) + default: + var itemInfo []*player_proto.PayItem + var items []*Item + if len(info.Amount) > 0 { + this.AddCoin(int64(info.Amount[0]), 0, info.GainWay, "Callback_login", info.Remark) + this.AddDiamond(int64(info.Amount[1]), 0, info.GainWay, "Callback_login", info.Remark) } - } - switch info.Remark { - case "BlindBox": - if len(info.OtherParams) > 0 { - this.WelfData.BlindBoxId = info.OtherParams[0] - } else { - logger.Logger.Errorf("GetPayGoodsInfo BlindBox OtherParams is nil") + this.AddMoneyPayTotal(int64(info.ConsumeNum)) + if info.ItemInfo != nil { + for _, v := range info.ItemInfo { + items = append(items, &Item{ItemId: v.ItemId, ItemNum: v.ItemNum}) + itemInfo = append(itemInfo, &player_proto.PayItem{ + ItemId: v.ItemId, + ItemNum: v.ItemNum, + }) + } } - case "FirstRecharge": - if len(info.OtherParams) > 0 { + switch info.Remark { + case "BlindBox": + if len(info.OtherParams) > 0 { + this.WelfData.BlindBoxId = info.OtherParams[0] + } else { + logger.Logger.Errorf("GetPayGoodsInfo BlindBox OtherParams is nil") + } + case "FirstRecharge": + if len(info.OtherParams) > 0 { - this.WelfData.FirstPayDay = info.OtherParams[0] - this.WelfData.FirstPayTickets = info.Ts - } else { - logger.Logger.Errorf("GetPayGoodsInfo FirstRecharge OtherParams is nil") + this.WelfData.FirstPayDay = info.OtherParams[0] + this.WelfData.FirstPayTickets = info.Ts + } else { + logger.Logger.Errorf("GetPayGoodsInfo FirstRecharge OtherParams is nil") + } + case "ContinuousPay": + if len(info.OtherParams) > 0 { + + this.WelfData.ContinuousPayDay = info.OtherParams[0] + this.WelfData.ContinuousPayTickets = info.Ts + } else { + logger.Logger.Errorf("GetPayGoodsInfo ContinuousPay OtherParams is nil") + } } - case "ContinuousPay": - if len(info.OtherParams) > 0 { + this.UpdatePlayerVipBag(info.ShopId) + this.UpdateShopID(info.ShopId) - this.WelfData.ContinuousPayDay = info.OtherParams[0] - this.WelfData.ContinuousPayTickets = info.Ts - } else { - logger.Logger.Errorf("GetPayGoodsInfo ContinuousPay OtherParams is nil") + this.dirty = true + this.SendDiffData() + + info.Amount[2] = this.GetVIPExpByPay(info.ConsumeNum) + + BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false) + + PayGoodsInfo := &player_proto.SCPayGoodsInfo{ + Gold: info.Amount, + Item: itemInfo, } + proto.SetDefaults(PayGoodsInfo) + this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo) } - this.UpdatePlayerVipBag(info.ShopId) - this.UpdateShopID(info.ShopId) - - this.dirty = true - this.SendDiffData() - - info.Amount[2] = this.GetVIPExpByPay(info.ConsumeNum) - - BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false) - - PayGoodsInfo := &player_proto.SCPayGoodsInfo{ - Gold: info.Amount, - Item: itemInfo, + if info.ConsumeNum > 0 { + TaskSubjectSingleton.Touch(common.TaskTypePay, &TaskData{ + SnId: this.SnId, + Num: int64(info.ConsumeNum), + }) } - proto.SetDefaults(PayGoodsInfo) - this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo) - TaskSubjectSingleton.Touch(common.TaskTypePay, &TaskData{ - SnId: this.SnId, - Num: int64(info.ConsumeNum), - }) } } diff --git a/worldsrv/shopmgr.go b/worldsrv/shopmgr.go index 0865332..01f77d7 100644 --- a/worldsrv/shopmgr.go +++ b/worldsrv/shopmgr.go @@ -51,6 +51,7 @@ const ( ShopPagePhoneScoreGoogle = 62 ShopPageGift = 7 //礼包页面 ShopPageDiamondBank = 8 //钻石存储罐 + ShopPageBackend = 9 //并不是页面,是后台加币记录类型 ) // 商品类型 diff --git a/worldsrv/trascate_webapi.go b/worldsrv/trascate_webapi.go index cf6c826..9659207 100644 --- a/worldsrv/trascate_webapi.go +++ b/worldsrv/trascate_webapi.go @@ -1772,6 +1772,17 @@ func init() { logger.Logger.Errorf("model.UpdatePlayerCoin err:%v.", err) return nil } + + // 充值金额记录 + if money > 0 { + err = model.InsertDbShopLog(model.NewDbShop(findPlayer.Platform, ShopPageBackend, nil, "", 0, 0, int32(money), + 0, nil, 0, "", findPlayer.SnId, 3, "后台离线加币", nil)) + if err != nil { + logger.Logger.Errorf("model.InsertDbShopLog err:%v.", err) + return nil + } + } + //账变记录 err = model.InsertCoinLog(coinlogex) if err != nil { diff --git a/xlsx/DB_GameItem.xlsx b/xlsx/DB_GameItem.xlsx index 928c317..6dc82a0 100644 Binary files a/xlsx/DB_GameItem.xlsx and b/xlsx/DB_GameItem.xlsx differ