fix(charge):修复用户充值记录创建的时候对于数值类型内容解析的问题。

This commit is contained in:
徐涛
2023-06-08 21:47:04 +08:00
parent 33ccd7e0b6
commit 0c725e99a4
2 changed files with 13 additions and 8 deletions

View File

@@ -50,11 +50,14 @@ func createNewUserChargeRecord(c *fiber.Ctx) error {
chargeLog.Error("无法解析创建充值记录的请求数据。", zap.Error(err))
return result.Error(http.StatusBadRequest, err.Error())
}
fee, _ := createionForm.Fee.Float64()
discount, _ := createionForm.Discount.Float64()
amount, _ := createionForm.Amount.Float64()
ok, err := service.ChargeService.RecordUserCharge(
createionForm.UserId,
createionForm.Fee,
createionForm.Discount,
createionForm.Amount,
&fee,
&discount,
&amount,
createionForm.ChargeTo,
true,
)