From 9b50471d61a4d5ec83c22c2a4f8f9731ef954ff5 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 26 Jun 2024 17:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E9=82=80=E8=AF=B7=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E5=85=85=E5=80=BC=E7=BB=99=E8=87=AA=E5=B7=B1=E5=8A=A0?= =?UTF-8?q?=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constant.go | 1 + dbproxy/mq/c_invite.go | 1 + dbproxy/svc/l_invitescore.go | 33 +++++++++++++++++++++++++++++++++ worldsrv/welfmgr.go | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/common/constant.go b/common/constant.go index 1171250..5cfc959 100644 --- a/common/constant.go +++ b/common/constant.go @@ -700,6 +700,7 @@ const ( InviteScoreTypeBind = 1 // 绑定邀请码 InviteScoreTypePay = 2 // 充值 InviteScoreTypeRecharge = 3 // 充值完成 + InviteScoreTypePayMe = 4 // 充值(给自己) ) func InMatchChannel(ls []string, n string) bool { diff --git a/dbproxy/mq/c_invite.go b/dbproxy/mq/c_invite.go index 3c2a002..4d0ec74 100644 --- a/dbproxy/mq/c_invite.go +++ b/dbproxy/mq/c_invite.go @@ -169,6 +169,7 @@ func init() { case common.InviteScoreTypePay: // 更新充值积分,上级积分增加 + add(log.SnId, log.Score, 0, 10000) var psnid int32 if len(log.Rate) > 0 { add(log.InviteSnId, log.Score, log.Money, log.Rate[0]) diff --git a/dbproxy/svc/l_invitescore.go b/dbproxy/svc/l_invitescore.go index 9726e30..22970f4 100644 --- a/dbproxy/svc/l_invitescore.go +++ b/dbproxy/svc/l_invitescore.go @@ -102,6 +102,21 @@ func SaveInviteScore(req *model.InviteScore, rechargeScore int64) (b bool, err e logger.Logger.Errorf("SaveInviteScore Insert 1 error:%v", err) return false, err } + // 自己加积分 + err = c.Insert(&model.InviteScore{ + Platform: req.Platform, + SnId: req.SnId, + InviteSnId: req.InviteSnId, + Tp: common.InviteScoreTypePayMe, + Score: req.Score, + Ts: req.Ts, + Money: req.Money, + Rate: req.Rate, + }) + if err != nil { + logger.Logger.Errorf("SaveInviteScore Insert me error:%v", err) + return false, err + } } } else { // 没有充值成功记录 @@ -110,6 +125,24 @@ func SaveInviteScore(req *model.InviteScore, rechargeScore int64) (b bool, err e logger.Logger.Errorf("SaveInviteScore Insert 2 error:%v", err) return false, err } + if req.Tp == common.InviteScoreTypePay { + // 自己加积分 + err = c.Insert(&model.InviteScore{ + Platform: req.Platform, + SnId: req.SnId, + InviteSnId: req.InviteSnId, + Tp: common.InviteScoreTypePayMe, + Score: req.Score, + Ts: req.Ts, + Money: req.Money, + Rate: req.Rate, + }) + if err != nil { + logger.Logger.Errorf("SaveInviteScore Insert me 2 error:%v", err) + return false, err + } + } + newReq := *req if newReq.Tp != common.InviteScoreTypeRecharge { newReq.Id = bson.NewObjectId() diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 30f5822..d4408d9 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -1063,7 +1063,7 @@ func (this *WelfareMgr) BlindBoxInfo(p *Player, bid int32) { if cyc == 1 || blindBox.Cycle == model.WelfareOpen { p.WelfData.BlindBoxId = 0 } - } // == 1代表当日循环 + } // == 1代表当日循环 if p.WelfData.BlindBoxId == 0 { // 未领取过发随机Date idx := bid