fix: preserve legacy payment account display

This commit is contained in:
richjohnrambo
2026-10-16 10:14:41 +08:00
parent ecf1a89313
commit 443622cd3c
4 changed files with 54 additions and 23 deletions
+5 -1
View File
@@ -156,14 +156,18 @@ func (s *Store) PaymentAccounts(ctx context.Context, tenantID, memberID int64) (
return items, err
}
// PaymentAccountDetails returns encrypted fields only for the authenticated account owner.
// PaymentAccountDetails returns encrypted fields and their masked fallbacks for the authenticated owner.
func (s *Store) PaymentAccountDetails(ctx context.Context, tenantID, memberID int64) ([]PaymentAccount, error) {
items := make([]PaymentAccount, 0)
err := s.db.SelectContext(ctx, &items, `SELECT a.id,a.account_type,a.bank_code,a.bank_name,
COALESCE(a.holder_cipher,'') AS holder_cipher,
COALESCE(a.holder_mask,'') AS holder_mask,
COALESCE(a.identity_no_cipher,'') AS identity_no_cipher,
COALESCE(a.identity_no_mask,'') AS identity_no_mask,
COALESCE(a.account_no_cipher,'') AS account_no_cipher,
COALESCE(a.account_no_mask,'') AS account_no_mask,
COALESCE(a.digital_rmb_code_cipher,'') AS digital_rmb_code_cipher,
COALESCE(a.digital_rmb_code_mask,'') AS digital_rmb_code_mask,
COALESCE(a.wechat_qr_attachment_id,0) AS wechat_qr_attachment_id,
COALESCE(a.alipay_qr_attachment_id,0) AS alipay_qr_attachment_id,
COALESCE(wechat.file_url,'') AS wechat_qr_url,