支持快手行业电子凭证多店铺授权

This commit is contained in:
yml2213
2026-07-08 14:13:15 +08:00
parent 102330d7af
commit ec23eb6af6
24 changed files with 1110 additions and 219 deletions
@@ -54,6 +54,7 @@ async function insertKuaishouIndustryVoucher(
order_id,
task_id,
unit_index,
seller_id,
token,
status,
valid_start_time,
@@ -77,15 +78,20 @@ async function insertKuaishouIndustryVoucher(
$8,
$9,
$10,
$11::jsonb,
$12,
$11,
$12::jsonb,
$13,
$14::jsonb,
$15,
$16
$14,
$15::jsonb,
$16,
$17
)
ON CONFLICT (oid, unit_index) DO UPDATE
SET
seller_id = CASE
WHEN EXCLUDED.seller_id <> '' THEN EXCLUDED.seller_id
ELSE kuaishou_industry_vouchers.seller_id
END,
token = CASE
WHEN EXCLUDED.token <> '' THEN EXCLUDED.token
ELSE kuaishou_industry_vouchers.token
@@ -104,6 +110,7 @@ async function insertKuaishouIndustryVoucher(
normalizeNullableId(input.orderId),
normalizeNullableId(input.taskId),
input.unitIndex,
input.sellerId || '',
input.token || '',
input.status || 'UNUSED',
input.validStartTime || 0,
@@ -234,6 +241,10 @@ function normalizeVoucherPatchColumns(
columns.push({ column: 'token', value: patch.token || '' })
}
if (patch.sellerId !== undefined) {
columns.push({ column: 'seller_id', value: patch.sellerId || '' })
}
if (patch.status !== undefined) {
columns.push({ column: 'status', value: patch.status || 'UNUSED' })
}