优化订单履约分流与后台筛选
This commit is contained in:
@@ -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[],
|
||||
|
||||
Reference in New Issue
Block a user