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

@@ -2,30 +2,29 @@ package model
import (
"electricity_bill_calc/types"
"time"
"github.com/shopspring/decimal"
)
type UserChargeDetail struct {
Seq int64 `json:"seq"`
UserId string `json:"user_id"`
Name string `json:"name"`
Fee *decimal.Decimal `json:"fee"`
Discount *decimal.Decimal `json:"discount"`
Amount *decimal.Decimal `json:"amount"`
ChargeTo types.Date `json:"charge_to"`
Settled bool `json:"settled"`
SettledAt *time.Time `json:"settled_at"`
Cancelled bool `json:"cancelled"`
CancelledAt *time.Time `json:"cancelled_at"`
CreatedAt time.Time `json:"created_at"`
Seq int64 `json:"seq"`
UserId string `json:"userId" db:"user_id"`
Name string `json:"name"`
Fee *float64 `json:"fee"`
Discount *float64 `json:"discount"`
Amount *float64 `json:"amount"`
ChargeTo types.Date `json:"chargeTo"`
Settled bool `json:"settled"`
SettledAt *types.DateTime `json:"settledAt"`
Cancelled bool `json:"cancelled"`
CancelledAt *types.DateTime `json:"cancelledAt"`
Refunded bool `json:"refunded"`
RefundedAt *types.DateTime `json:"refundedAt"`
CreatedAt types.DateTime `json:"createdAt"`
}
type ChargeRecordCreationForm struct {
UserId string `json:"userId"`
Fee *decimal.Decimal `json:"fee"`
Discount *decimal.Decimal `json:"discount"`
Amount *decimal.Decimal `json:"amount"`
ChargeTo types.Date `json:"chargeTo"`
UserId string `json:"userId"`
Fee *float64 `json:"fee"`
Discount *float64 `json:"discount"`
Amount *float64 `json:"amount"`
ChargeTo types.Date `json:"chargeTo"`
}