Ver Fonte

feat: 完善提现订单渠道及收款信息

urban há 6 horas atrás
pai
commit
bb8e9b90de
2 ficheiros alterados com 29 adições e 21 exclusões
  1. 13 9
      apis/daytask/wallet.go
  2. 16 12
      commons/model/entity/dt_withdraw_order.go

+ 13 - 9
apis/daytask/wallet.go

@@ -159,15 +159,19 @@ func (s *Server) WalletWithdraw(c *gin.Context) {
 
 	// 创建提现订单
 	order := &entity.DtWithdrawOrder{
-		OrderNo:      orderNo,
-		UserId:       userId,
-		Amount:       req.Amount,
-		Fee:          fee,
-		ActualAmount: actualAmount,
-		PaymentType:  payment.Type,
-		PaymentId:    payment.Id,
-		PaymentInfo:  string(paymentInfo),
-		Status:       entity.WithdrawStatusPending,
+		OrderNo:        orderNo,
+		UserId:         userId,
+		Amount:         req.Amount,
+		Fee:            fee,
+		ActualAmount:   actualAmount,
+		Channel:        payment.Type,
+		PaymentType:    payment.Type,
+		PaymentId:      payment.Id,
+		PaymentInfo:    string(paymentInfo),
+		ReceiveAccount: payment.Account,
+		ReceiveName:    payment.Name,
+		BankName:       payment.BankName,
+		Status:         entity.WithdrawStatusPending,
 	}
 	if err := tx.Create(order).Error; err != nil {
 		tx.Rollback()

+ 16 - 12
commons/model/entity/dt_withdraw_order.go

@@ -3,18 +3,22 @@ package entity
 // DtWithdrawOrder 提现订单表
 type DtWithdrawOrder struct {
 	MysqlBaseModel
-	OrderNo       string  `json:"orderNo" gorm:"type:varchar(32);uniqueIndex:uk_order_no;comment:订单号"`
-	UserId        int64   `json:"userId" gorm:"index:idx_user_id;comment:用户ID"`
-	Amount        float64 `json:"amount" gorm:"type:decimal(18,2);comment:提现金额"`
-	Fee           float64 `json:"fee" gorm:"type:decimal(18,2);default:0.00;comment:手续费"`
-	ActualAmount  float64 `json:"actualAmount" gorm:"type:decimal(18,2);comment:实际到账金额"`
-	PaymentType   string  `json:"paymentType" gorm:"type:varchar(32);comment:收款类型: usdt/bank/momo/zalopay"`
-	PaymentId     int64   `json:"paymentId" gorm:"comment:收款账户ID"`
-	PaymentInfo   string  `json:"paymentInfo" gorm:"type:text;comment:收款账户信息(JSON)"`
-	AuditTime     int64   `json:"auditTime" gorm:"comment:审核时间"`
-	AuditAdminId  int64   `json:"auditAdminId" gorm:"comment:审核管理员ID"`
-	AuditRemark   string  `json:"auditRemark" gorm:"type:varchar(512);comment:审核备注"`
-	Status        int8    `json:"status" gorm:"default:0;index:idx_status;comment:状态: -1=已拒绝 0=待审核 1=已通过"`
+	OrderNo        string  `json:"orderNo" gorm:"type:varchar(32);uniqueIndex:uk_order_no;comment:订单号"`
+	UserId         int64   `json:"userId" gorm:"index:idx_user_id;comment:用户ID"`
+	Amount         float64 `json:"amount" gorm:"type:decimal(18,2);comment:提现金额"`
+	Fee            float64 `json:"fee" gorm:"type:decimal(18,2);default:0.00;comment:手续费"`
+	ActualAmount   float64 `json:"actualAmount" gorm:"type:decimal(18,2);comment:实际到账金额"`
+	Channel        string  `json:"channel" gorm:"type:varchar(32);comment:提现渠道: usdt/momo/zalopay/bank"`
+	PaymentType    string  `json:"paymentType" gorm:"type:varchar(32);comment:收款类型: usdt/bank/momo/zalopay"`
+	PaymentId      int64   `json:"paymentId" gorm:"comment:收款账户ID"`
+	PaymentInfo    string  `json:"paymentInfo" gorm:"type:text;comment:收款账户信息(JSON)"`
+	ReceiveAccount string  `json:"receiveAccount" gorm:"type:varchar(128);comment:收款账号"`
+	ReceiveName    string  `json:"receiveName" gorm:"type:varchar(64);comment:收款人姓名"`
+	BankName       string  `json:"bankName" gorm:"type:varchar(64);comment:银行名称"`
+	AuditTime      int64   `json:"auditTime" gorm:"comment:审核时间"`
+	AuditAdminId   int64   `json:"auditAdminId" gorm:"comment:审核管理员ID"`
+	AuditRemark    string  `json:"auditRemark" gorm:"type:varchar(512);comment:审核备注"`
+	Status         int8    `json:"status" gorm:"default:0;index:idx_status;comment:状态: -1=已拒绝 0=待审核 1=已通过"`
 }
 
 func (*DtWithdrawOrder) TableName() string {