优化订单履约分流与后台筛选

This commit is contained in:
yml2213
2026-09-02 11:59:38 +08:00
parent 50c526a855
commit de63daf1ac
19 changed files with 1269 additions and 162 deletions
@@ -21,6 +21,22 @@ export async function listOrderItemsByOrderId(orderId: number | string): Promise
return listOrderItemsByOrderIdWithExecutor(query, orderId)
}
export async function listOrderItemsByOrderIds(orderIds: number[]): Promise<OrderItemRow[]> {
const normalizedIds = orderIds.map(Number).filter((value) => value > 0)
if (normalizedIds.length === 0) return []
const result = await query<OrderItemRow>(
`
SELECT *
FROM order_items
WHERE order_id = ANY($1::bigint[])
ORDER BY order_id ASC, id ASC
`,
[normalizedIds],
)
return result.rows
}
export async function replaceOrderItems(
orderId: number | string,
items: OrderItemReplaceInput[],