完善支付宝提现收款码

This commit is contained in:
yml2213
2026-08-21 00:00:05 +08:00
parent 81a412323b
commit 361b84931f
14 changed files with 362 additions and 35 deletions
@@ -161,6 +161,7 @@ export type WorkerWithdrawalAccountRow = {
account_channel: string
account_name: string
account_no: string
alipay_qr_code_json: string | Record<string, unknown>
wechat_qr_code_json: string | Record<string, unknown>
created_at: string
}
@@ -654,14 +654,16 @@ export async function createWorkerWithdrawalAccount(input: {
accountChannel: string
accountName: string
accountNo: string
alipayQrCodeJson: string
wechatQrCodeJson: string
now: string
}): Promise<WorkerWithdrawalAccountRow | null> {
const result = await query<WorkerWithdrawalAccountRow>(
`
INSERT INTO worker_withdrawal_accounts (
worker_id, account_channel, account_name, account_no, wechat_qr_code_json, created_at
) VALUES ($1, $2, $3, $4, $5::jsonb, $6)
worker_id, account_channel, account_name, account_no,
alipay_qr_code_json, wechat_qr_code_json, created_at
) VALUES ($1, $2, $3, $4, $5::jsonb, $6::jsonb, $7)
ON CONFLICT (worker_id, account_channel) DO NOTHING
RETURNING *
`,
@@ -670,6 +672,7 @@ export async function createWorkerWithdrawalAccount(input: {
input.accountChannel,
input.accountName,
input.accountNo,
input.alipayQrCodeJson,
input.wechatQrCodeJson,
input.now,
],
@@ -682,18 +685,21 @@ export async function upsertWorkerWithdrawalAccount(input: {
accountChannel: string
accountName: string
accountNo: string
alipayQrCodeJson: string
wechatQrCodeJson: string
now: string
}): Promise<WorkerWithdrawalAccountRow | null> {
const result = await query<WorkerWithdrawalAccountRow>(
`
INSERT INTO worker_withdrawal_accounts (
worker_id, account_channel, account_name, account_no, wechat_qr_code_json, created_at
) VALUES ($1, $2, $3, $4, $5::jsonb, $6)
worker_id, account_channel, account_name, account_no,
alipay_qr_code_json, wechat_qr_code_json, created_at
) VALUES ($1, $2, $3, $4, $5::jsonb, $6::jsonb, $7)
ON CONFLICT (worker_id, account_channel) DO UPDATE
SET
account_name = EXCLUDED.account_name,
account_no = EXCLUDED.account_no,
alipay_qr_code_json = EXCLUDED.alipay_qr_code_json,
wechat_qr_code_json = EXCLUDED.wechat_qr_code_json
RETURNING *
`,
@@ -702,6 +708,7 @@ export async function upsertWorkerWithdrawalAccount(input: {
input.accountChannel,
input.accountName,
input.accountNo,
input.alipayQrCodeJson,
input.wechatQrCodeJson,
input.now,
],