Browse Source

修复支付订单bug

kobe6258 5 months ago
parent
commit
64c7a75444
2 changed files with 17 additions and 16 deletions
  1. 1 1
      domian/order/trade_order.go
  2. 16 15
      models/order/trade_order.go

+ 1 - 1
domian/order/trade_order.go

@@ -60,7 +60,7 @@ func CreateTradeOrder(userId, templateUserId int, productOrderNo, tradeOrderNo,
 		Amount:         productOrder.TotalAmount,
 		Currency:       RMB,
 		MerchantID:     merchantNo,
-		UserID:         templateUserId,
+		UserID:         userId,
 		TemplateUserID: templateUserId,
 		PaymentType:    order.PaymentTypePay,
 	}

+ 16 - 15
models/order/trade_order.go

@@ -20,21 +20,22 @@ const (
 )
 
 type TradeOrder struct {
-	ID             int           `gorm:"column:id;primaryKey"`
-	TransactionID  string        `gorm:"column:transaction_id;type:varchar(255);comment:第三方平台ID"`
-	ProductOrderID string        `gorm:"column:product_order_id;type:varchar(255);comment:商品订单号"`
-	PaymentAccount string        `gorm:"column:payment_account;type:varchar(255);comment:支付账号"`
-	PaymentWay     string        `gorm:"column:payment_way;type:enum('wechat');comment:支付渠道"`
-	Amount         string        `gorm:"column:amount;type:varchar(20);comment:支付金额"`
-	Currency       string        `gorm:"column:currency;type:varchar(255);comment:货币"`
-	MerchantID     string        `gorm:"column:merchant_id;type:varchar(255);comment:商户id"`
-	UserID         int           `gorm:"column:user_id;type:int(11);comment:用户id"`
-	TemplateUserID int           `gorm:"column:template_user_id;type:int(11);comment:临时用户id"`
-	PaymentType    PaymentType   `gorm:"column:payment_type;type:enum('pay','refund');comment:订单类型"`
-	PaymentStatus  PaymentStatus `gorm:"column:payment_status;type:enum('pending','processing','done','failed');comment:支付状态"`
-	DealTime       time.Time     `gorm:"column:deal_time;type:datetime;comment:完成时间"`
-	CreatedTime    time.Time     `gorm:"column:created_time;type:datetime;comment:创建时间"`
-	UpdatedTime    time.Time     `gorm:"column:updated_time;type:datetime;comment:更新时间"`
+	ID               int           `gorm:"column:id;primaryKey"`
+	TransactionID    string        `gorm:"column:transaction_id;type:varchar(255);comment:第三方平台ID"`
+	OrgTransactionID string        `gorm:"column:org_transaction_id;type:varchar(255);comment:第三方平台ID"`
+	ProductOrderID   string        `gorm:"column:product_order_id;type:varchar(255);comment:商品订单号"`
+	PaymentAccount   string        `gorm:"column:payment_account;type:varchar(255);comment:支付账号"`
+	PaymentWay       string        `gorm:"column:payment_way;type:enum('wechat');comment:支付渠道"`
+	Amount           string        `gorm:"column:amount;type:varchar(20);comment:支付金额"`
+	Currency         string        `gorm:"column:currency;type:varchar(255);comment:货币"`
+	MerchantID       string        `gorm:"column:merchant_id;type:varchar(255);comment:商户id"`
+	UserID           int           `gorm:"column:user_id;type:int(11);comment:用户id"`
+	TemplateUserID   int           `gorm:"column:template_user_id;type:int(11);comment:临时用户id"`
+	PaymentType      PaymentType   `gorm:"column:payment_type;type:enum('pay','refund');comment:订单类型"`
+	PaymentStatus    PaymentStatus `gorm:"column:payment_status;type:enum('pending','processing','done','failed');comment:支付状态"`
+	DealTime         time.Time     `gorm:"column:deal_time;type:datetime;comment:完成时间"`
+	CreatedTime      time.Time     `gorm:"column:created_time;type:datetime;comment:创建时间"`
+	UpdatedTime      time.Time     `gorm:"column:updated_time;type:datetime;comment:更新时间"`
 }
 
 func (to *TradeOrder) TableName() string {