This commit is contained in:
@@ -3,6 +3,8 @@ package model
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/pkg/constants"
|
||||
)
|
||||
|
||||
type Payment struct {
|
||||
@@ -11,11 +13,13 @@ type Payment struct {
|
||||
OrderID uint `gorm:"column:order_id;not null" json:"order_id"`
|
||||
OrderType string `gorm:"column:order_type;type:varchar(30);not null" json:"order_type"`
|
||||
PaymentMethod string `gorm:"column:payment_method;type:varchar(20);not null" json:"payment_method"`
|
||||
MerchantIdentity string `gorm:"column:merchant_identity;type:varchar(100)" json:"-"`
|
||||
Amount int64 `gorm:"column:amount;type:bigint;not null" json:"amount"`
|
||||
Status int `gorm:"column:status;type:smallint;not null;default:0" json:"status"`
|
||||
ThirdPartyTradeNo string `gorm:"column:third_party_trade_no;type:varchar(100)" json:"third_party_trade_no,omitempty"`
|
||||
PaymentConfigID *uint `gorm:"column:payment_config_id" json:"payment_config_id,omitempty"`
|
||||
PaymentVoucherKey string `gorm:"column:payment_voucher_key;type:varchar(500)" json:"payment_voucher_key,omitempty"`
|
||||
QRContent string `gorm:"column:qr_content;type:text" json:"-"`
|
||||
PaidAt *time.Time `gorm:"column:paid_at" json:"paid_at,omitempty"`
|
||||
ExpireAt *time.Time `gorm:"column:expire_at" json:"expire_at,omitempty"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
|
||||
@@ -28,15 +32,16 @@ func (Payment) TableName() string {
|
||||
}
|
||||
|
||||
const (
|
||||
PaymentRecordStatusPending = 0 // 待支付
|
||||
PaymentRecordStatusPaid = 1 // 已支付
|
||||
PaymentRecordStatusFailed = 2 // 已失败
|
||||
PaymentRecordStatusRefunded = 3 // 已退款
|
||||
PaymentRecordStatusPending = constants.PaymentRecordStatusPending // 待支付
|
||||
PaymentRecordStatusPaid = constants.PaymentRecordStatusPaid // 已支付
|
||||
PaymentRecordStatusFailed = constants.PaymentRecordStatusFailed // 已失败
|
||||
PaymentRecordStatusRefunded = constants.PaymentRecordStatusRefunded // 已退款
|
||||
)
|
||||
|
||||
const (
|
||||
PaymentOrderTypePackage = "package_order"
|
||||
PaymentOrderTypeRecharge = "recharge_order"
|
||||
PaymentOrderTypePackage = "package_order" // 套餐订单
|
||||
PaymentOrderTypeRecharge = "recharge_order" // 客户充值订单
|
||||
PaymentOrderTypeAgentRecharge = "agent_recharge" // 代理充值订单
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user