支持后台修改打手提现信息

This commit is contained in:
yml2213
2026-08-17 11:28:23 +08:00
parent ea5c2a4105
commit 77ed97fe1f
6 changed files with 317 additions and 1 deletions
@@ -497,6 +497,38 @@ export async function createWorkerWithdrawalAccount(input: {
return result.rows[0] || null
}
export async function upsertWorkerWithdrawalAccount(input: {
workerId: number
accountChannel: string
accountName: string
accountNo: 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)
ON CONFLICT (worker_id, account_channel) DO UPDATE
SET
account_name = EXCLUDED.account_name,
account_no = EXCLUDED.account_no,
wechat_qr_code_json = EXCLUDED.wechat_qr_code_json
RETURNING *
`,
[
input.workerId,
input.accountChannel,
input.accountName,
input.accountNo,
input.wechatQrCodeJson,
input.now,
],
)
return result.rows[0] || null
}
export async function getWorkerFinanceRequestById(
requestId: number | string,
): Promise<WorkerFinanceRequestRow | null> {