增加提现相关的与打款相关逻辑
This commit is contained in:
@@ -40,6 +40,7 @@ type WithdrawalDetailDTO struct {
|
||||
AccountNo string `json:"account_no"` // 管理员可见完整账号
|
||||
BankName string `json:"bank_name"`
|
||||
BankBranch string `json:"bank_branch"`
|
||||
CertificateURLs []string `json:"certificate_urls"` // 收款二维码图片
|
||||
Status string `json:"status"`
|
||||
ReviewedBy *uint64 `json:"reviewed_by"`
|
||||
ReviewedByName string `json:"reviewed_by_name"`
|
||||
|
||||
@@ -3,12 +3,14 @@ package withdrawal
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"hfb_sys/backend/internal/model"
|
||||
"hfb_sys/backend/internal/modules/wallet"
|
||||
"hfb_sys/backend/pkg/crypto"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -414,15 +416,21 @@ func (r *Repository) toDetailDTO(w model.WithdrawalRequest) (*WithdrawalDetailDT
|
||||
}
|
||||
}
|
||||
|
||||
// 获取完整账号(管理员可见)
|
||||
// 获取完整账号和收款二维码(管理员可见)
|
||||
fullAccountNo := w.AccountNo
|
||||
var certificateURLs []string
|
||||
if w.PaymentAccountID != nil {
|
||||
var paymentAccount model.UserPaymentAccount
|
||||
if err := r.db.First(&paymentAccount, *w.PaymentAccountID).Error; err == nil {
|
||||
decrypted, err := r.decryptAccountNo(paymentAccount.AccountNo)
|
||||
// 解密账号
|
||||
decrypted, err := crypto.Decrypt(paymentAccount.AccountNo)
|
||||
if err == nil {
|
||||
fullAccountNo = decrypted
|
||||
}
|
||||
// 解析收款二维码
|
||||
if paymentAccount.CertificateURLs != nil {
|
||||
json.Unmarshal(paymentAccount.CertificateURLs, &certificateURLs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,6 +449,7 @@ func (r *Repository) toDetailDTO(w model.WithdrawalRequest) (*WithdrawalDetailDT
|
||||
AccountNo: fullAccountNo,
|
||||
BankName: w.BankName,
|
||||
BankBranch: w.BankBranch,
|
||||
CertificateURLs: certificateURLs,
|
||||
Status: w.Status,
|
||||
ReviewedBy: w.ReviewedBy,
|
||||
ReviewedByName: reviewedByName,
|
||||
|
||||
Reference in New Issue
Block a user