充值明细 优化

This commit is contained in:
lwl0608 2024-03-19 10:30:25 +08:00
parent 184a3ff5e2
commit 05fbd7e04e
3 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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)
}

View File

@ -499,6 +499,7 @@ const (
CHSTypeChargeOp = 20002 // 充值明细OP充值
CHSTypeChargeRefund = 20003 // 充值明细,现金退款
CHSTypeChargeRefundMembership = 20004 // 充值明细,会员退款
CHSTypeChargeMembership = 20005 // 充值明细,会员充值
CHSTypeIncomeContact = 30001 // 收入明细,联系方式
CHSTypeIncomeInvite = 30002 // 收入明细,邀请分成