充值明细 优化
This commit is contained in:
parent
184a3ff5e2
commit
05fbd7e04e
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -499,6 +499,7 @@ const (
|
|||
CHSTypeChargeOp = 20002 // 充值明细,OP充值
|
||||
CHSTypeChargeRefund = 20003 // 充值明细,现金退款
|
||||
CHSTypeChargeRefundMembership = 20004 // 充值明细,会员退款
|
||||
CHSTypeChargeMembership = 20005 // 充值明细,会员充值
|
||||
|
||||
CHSTypeIncomeContact = 30001 // 收入明细,联系方式
|
||||
CHSTypeIncomeInvite = 30002 // 收入明细,邀请分成
|
||||
|
|
Loading…
Reference in New Issue