feat: 主要修复订单 save 逻辑 #46

Merged
longbot merged 6 commits from zksu/API:main into main 2026-01-10 07:18:26 +00:00
1 changed files with 2 additions and 5 deletions
Showing only changes of commit 5d7e0090aa - Show all commits

View File

@ -722,14 +722,14 @@ export class OrderService {
return {
product: await this.productModel.findOne({
where: { sku: comp.sku },
relations: ['components','attributes'],
relations: ['components', 'attributes'],
}),
quantity: comp.quantity * orderItem.quantity,
}
})) : [{ product, quantity: orderItem.quantity }]
const orderSales: OrderSale[] = componentDetails.map(componentDetail => {
if(!componentDetail.product) return null
if (!componentDetail.product) return null
const attrsObj = this.productService.getAttributesObject(product.attributes)
const orderSale = plainToClass(OrderSale, {
orderId: orderItem.orderId,
@ -2639,7 +2639,4 @@ export class OrderService {
throw new Error(`导出CSV文件失败: ${error.message}`);
}
}
}