支持后台修改打手提现信息
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user