支持快手行业电子凭证多店铺授权
This commit is contained in:
@@ -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' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user