diff --git a/src/service/order.service.ts b/src/service/order.service.ts index 3a8e70b..2b899c2 100644 --- a/src/service/order.service.ts +++ b/src/service/order.service.ts @@ -733,7 +733,7 @@ export class OrderService { if (!orderItem.sku) return; // 从数据库查询产品,关联查询组件 - const componentDetails = await this.productService.getComponentDetailFromSiteSku({ sku: orderItem.sku, name: orderItem.name },orderItem.quantity,site); + const componentDetails = await this.productService.getComponentDetailFromSiteSku({ sku: orderItem.sku, name: orderItem.name }, site); if(!componentDetails?.length){ return } diff --git a/src/service/product.service.ts b/src/service/product.service.ts index 47b9aa2..9984dcf 100644 --- a/src/service/product.service.ts +++ b/src/service/product.service.ts @@ -1786,7 +1786,7 @@ export class ProductService { } } // 获取库存单品列表 - async getComponentDetailFromSiteSku(siteProduct: { sku: string, name: string }, quantity: number = 1, site: Site): Promise<{ product: Product,parentProduct?: Product, quantity: number }[]> { + async getComponentDetailFromSiteSku(siteProduct: { sku: string, name: string }, site: Site): Promise<{ product: Product,parentProduct?: Product, quantity: number }[]> { if (!siteProduct.sku) { throw new Error('siteSku 不能为空') } @@ -1798,7 +1798,7 @@ export class ProductService { if(!product?.components?.length){ return [{ product, - quantity + quantity:1 }] } @@ -1808,7 +1808,7 @@ export class ProductService { where: { id: comp.productId }, }), parentProduct: product, // 这里得记录一下他的爸爸用来记录 - quantity: comp.quantity * quantity, + quantity: comp.quantity, } })) }