From 05fbd7e04e06bc6346f2359ecf11a367b8259960 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Tue, 19 Mar 2024 10:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=98=8E=E7=BB=86=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mix/service/logic/vas.go | 6 +++++- app/mix/service/vasservice.go | 3 +++ dbstruct/vas_mysql.go | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index f2cc1638..9f29bea6 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -1720,7 +1720,7 @@ func (v *Vas) PayCallback(ctx *gin.Context, p *vasproto.PayCallbackParamIn) { Mid: goproto.Int64(order.GetMid()), Type: goproto.Int32(dbstruct.CHTypeCharge), SType: goproto.Int32(dbstruct.CHSTypeChargeUser), - TypeId: goproto.String(dbstruct.ProductTypeCoins), + TypeId: goproto.String(product.Id), OrderId: goproto.String(orderId), Change: goproto.Int64(order.GetCoins()), Before: goproto.Int64(wallet.GetCoins()), @@ -1728,6 +1728,10 @@ func (v *Vas) PayCallback(ctx *gin.Context, p *vasproto.PayCallbackParamIn) { Count: goproto.Int64(order.GetCoins()), Ct: goproto.Int64(time.Now().Unix()), } + switch product.Id { + case dbstruct.ProductIdMembership: + ch.SType = goproto.Int32(dbstruct.CHSTypeChargeMembership) + } err = v.store.CreateConsumeHistory(ctx, tx, ch) if err != nil { logger.Error("CreateConsumeHistory fail, ch: %v, err: %v", util.ToJson(ch), err) diff --git a/app/mix/service/vasservice.go b/app/mix/service/vasservice.go index 0018e4d8..1cf79b0d 100644 --- a/app/mix/service/vasservice.go +++ b/app/mix/service/vasservice.go @@ -288,6 +288,9 @@ func (s *Service) chListCharge(ctx *gin.Context, chList []*dbstruct.ConsumeHisto case dbstruct.CHSTypeChargeRefundMembership: item.Desc = "会员退款" item.Change = fmt.Sprintf("%d金币", chDB.GetChange()) + case dbstruct.CHSTypeChargeMembership: + item.Desc = "会员充值" + item.Change = changeMark + fmt.Sprintf("%d金币", chDB.GetChange()) } list = append(list, item) } diff --git a/dbstruct/vas_mysql.go b/dbstruct/vas_mysql.go index 17f4b21b..9502602f 100644 --- a/dbstruct/vas_mysql.go +++ b/dbstruct/vas_mysql.go @@ -499,6 +499,7 @@ const ( CHSTypeChargeOp = 20002 // 充值明细,OP充值 CHSTypeChargeRefund = 20003 // 充值明细,现金退款 CHSTypeChargeRefundMembership = 20004 // 充值明细,会员退款 + CHSTypeChargeMembership = 20005 // 充值明细,会员充值 CHSTypeIncomeContact = 30001 // 收入明细,联系方式 CHSTypeIncomeInvite = 30002 // 收入明细,邀请分成