fix(charge):改进用户充值部分的查询错误。

This commit is contained in:
徐涛
2023-06-08 21:35:34 +08:00
parent 62560e4eeb
commit 40abbcfb8c
5 changed files with 53 additions and 42 deletions

View File

@@ -8,7 +8,6 @@ import (
"electricity_bill_calc/types"
"fmt"
"github.com/shopspring/decimal"
"go.uber.org/zap"
)
@@ -21,13 +20,13 @@ var ChargeService = &_ChargeService{
}
// 创建一条新的用户充值记录,同时更新用户的服务期限
func (cs _ChargeService) RecordUserCharge(uid string, fee, discount, amount *decimal.Decimal, chargeTo types.Date, extendExpriationIgnoringSettle bool) (bool, error) {
func (cs _ChargeService) RecordUserCharge(uid string, fee, discount, amount *float64, chargeTo types.Date, extendExpriationIgnoringSettle bool) (bool, error) {
cs.log.Info(
"创建一条新的用户充值记录。",
zap.String("uid", uid),
logger.DecimalFieldp("fee", fee),
logger.DecimalFieldp("discount", discount),
logger.DecimalFieldp("amount", amount),
zap.Float64p("fee", fee),
zap.Float64p("discount", discount),
zap.Float64p("amount", amount),
logger.DateField("chargeTo", chargeTo),
zap.Bool("extendExpriationIgnoringSettle", extendExpriationIgnoringSettle),
)