充值接口调整

This commit is contained in:
meixiongfeng 2023-11-22 14:35:07 +08:00
parent 47accf4860
commit 6f3d6416c3
6 changed files with 20 additions and 22 deletions

View File

@ -544,9 +544,9 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat
this.Debugf("发放装备资源: %v errdata: %v", equips, errdata) this.Debugf("发放装备资源: %v errdata: %v", equips, errdata)
} }
if len(vip) > 0 { //卡片资源 if len(vip) > 0 { //卡片资源
for k := range vip { for _, v := range vip {
errdata, _ = this.ModulePrivilege.Delivery(session, k) errdata, _ = this.ModulePrivilege.Delivery(session, v)
this.Debugf("发放月卡资源: %v errdata: %v", k, errdata) this.Debugf("发放月卡资源: %v errdata: %v", v, errdata)
} }
} }
if len(atlas) > 0 { if len(atlas) > 0 {
@ -809,9 +809,9 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea
this.Debugf("发放装备资源: %v errdata: %v", equips, errdata) this.Debugf("发放装备资源: %v errdata: %v", equips, errdata)
} }
if len(vip) > 0 { //卡片资源 if len(vip) > 0 { //卡片资源
for k := range vip { for _, v := range vip {
errdata, _ = this.ModulePrivilege.Delivery(session, k) errdata, _ = this.ModulePrivilege.Delivery(session, v)
this.Debugf("发放月卡资源: %v errdata: %v", k, errdata) this.Debugf("发放月卡资源: %v errdata: %v", v, errdata)
} }
for k, v := range vip { for k, v := range vip {
atno = append(atno, &pb.UserAtno{ atno = append(atno, &pb.UserAtno{

View File

@ -22,6 +22,6 @@ func (this *apiComp) BuyYueka(session comm.IUserSession, req *pb.PrivilegeBuyYue
if errdata = this.BuyYuekaCheck(session, req); errdata != nil { if errdata = this.BuyYuekaCheck(session, req); errdata != nil {
return return
} }
errdata, _ = this.module.Delivery(session, req.CID) //errdata, _ = this.module.Delivery(session, req.CID)
return return
} }

View File

@ -70,14 +70,12 @@ func (this *Privilege) EventUserOffline(uid, sessionid string) {
} }
// 购买了一个新的特权 // 购买了一个新的特权
func (this *Privilege) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { func (this *Privilege) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) {
var ( var (
bFind bool bFind bool
cId int32 cId int32
) )
// 通过计费点获取 conf, err := this.configure.GetPrivilegeCard(pId)
cId = this.configure.GetPrivilegeCardByPid(pid)
conf, err := this.configure.GetPrivilegeCard(cId)
if err != nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,

View File

@ -52,7 +52,7 @@ func (this *PushGiftbag) OnInstallComp() {
} }
// 发货 // 发货
func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { func (this *PushGiftbag) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) {
var ( var (
confs []*cfg.GamePushGiftData confs []*cfg.GamePushGiftData
conf *cfg.GamePushGiftData conf *cfg.GamePushGiftData
@ -68,7 +68,7 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat
return return
} }
for _, v := range confs { for _, v := range confs {
if v.Recharge == pid { if v.Id == pId {
conf = v conf = v
break break
} }
@ -78,7 +78,7 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.String(), Title: pb.ErrorCode_ConfigNoFound.String(),
Message: fmt.Sprintf("no found pid:%s", pid), Message: fmt.Sprintf("no found pid:%s", pId),
} }
return return
} }

View File

@ -92,7 +92,7 @@ func (this *ShopCenter) ActivityCloseNotice(hdlist *pb.DBHuodong) {
} }
// 发货 // 发货
func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { func (this *ShopCenter) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) {
var ( var (
confs []*cfg.GameShopCenterControlData confs []*cfg.GameShopCenterControlData
conf *cfg.GameShopCenterControlData conf *cfg.GameShopCenterControlData
@ -109,7 +109,7 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata
} }
for _, v := range confs { for _, v := range confs {
if v.Point == pid { if v.Id == pId {
conf = v conf = v
} }
} }
@ -117,7 +117,7 @@ func (this *ShopCenter) Delivery(session comm.IUserSession, pid string) (errdata
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.String(), Title: pb.ErrorCode_ConfigNoFound.String(),
Message: fmt.Sprintf("no found Point:%s", pid), Message: fmt.Sprintf("no found Point:%s", pId),
} }
return return
} }

View File

@ -51,7 +51,7 @@ func (this *Warorder) OnInstallComp() {
} }
// 发货 // 发货
func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) { func (this *Warorder) Delivery(session comm.IUserSession, pId int32) (errdata *pb.ErrorData, items []*pb.UserAssets) {
var ( var (
confs []*cfg.GamePassCheckPriceData confs []*cfg.GamePassCheckPriceData
conf *cfg.GamePassCheckPriceData conf *cfg.GamePassCheckPriceData
@ -71,7 +71,7 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *
return return
} }
for _, v := range confs { for _, v := range confs {
if v.PayId == pid || v.PayproId == pid || v.PaymidId == pid { if v.PasscheckType == pId {
conf = v conf = v
break break
} }
@ -80,7 +80,7 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.String(), Title: pb.ErrorCode_ConfigNoFound.String(),
Message: fmt.Sprintf("no found pid:%s", pid), Message: fmt.Sprintf("no found pid:%s", pId),
} }
return return
} }
@ -108,12 +108,12 @@ func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *
dwarorder = &pb.DreamWarorder{} dwarorder = &pb.DreamWarorder{}
info.Warorder[conf.PasscheckType] = warorder info.Warorder[conf.PasscheckType] = warorder
} }
if conf.PayId == pid { if conf.PasscheckType == pId {
dwarorder.Vip = 1 dwarorder.Vip = 1
} else { } else {
dwarorder.Vip = 2 dwarorder.Vip = 2
} }
if conf.PayproId == pid || conf.PaymidId == pid { if conf.PasscheckType == pId {
if expconf, err = this.configure.getWarorderLvpMax(conf.PasscheckType); err != nil { if expconf, err = this.configure.getWarorderLvpMax(conf.PasscheckType); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,