修复不返回链接错误

This commit is contained in:
yml
2026-05-27 19:54:00 +08:00
parent db777d0491
commit 5e5413238f
7 changed files with 38 additions and 302 deletions
@@ -36,6 +36,25 @@ export async function findOrderByPlatformOrderId({
return result.rows[0] || null
}
export async function findLatestOrderByPlatformOrderId({
provider = '91kaquan',
platform,
platformOrderId,
}: Omit<OrderPlatformLookupInput, 'shopId'>): Promise<OrderRow | null> {
const result = await query<OrderRow>(
`
SELECT *
FROM orders
WHERE provider = $1 AND platform = $2 AND platform_order_id = $3
ORDER BY id DESC
LIMIT 1
`,
[provider, platform, platformOrderId],
)
return result.rows[0] || null
}
export async function createOrder(input: OrderCreateInput): Promise<OrderRow | null> {
const result = await query<OrderRow>(
`