From 7f04de45832fc8583b951ea8826f71676da5463c Mon Sep 17 00:00:00 2001 From: tikkhun Date: Fri, 16 Jan 2026 09:35:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(product):=20=E5=B0=86sku=E7=B2=BE=E7=A1=AE?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E6=94=B9=E4=B8=BA=E6=A8=A1=E7=B3=8A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除重复的sku过滤条件,统一使用LIKE进行模糊查询 --- src/service/product.service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/service/product.service.ts b/src/service/product.service.ts index 9ad03b7..170ddeb 100644 --- a/src/service/product.service.ts +++ b/src/service/product.service.ts @@ -288,7 +288,7 @@ export class ProductService { // 处理SKU过滤 if (query.where?.sku) { - qb.andWhere('product.sku = :sku', { sku: query.where.sku }); + qb.andWhere('product.sku LIKE :sku', { sku: `%${query.where.sku}%` }); } // 处理SKU列表过滤 @@ -296,10 +296,6 @@ export class ProductService { qb.andWhere('product.sku IN (:...skus)', { skus: query.where.skus }); } - // 处理where对象中的sku过滤 - if (query.where?.sku) { - qb.andWhere('product.sku = :whereSku', { whereSku: query.where.sku }); - } // 处理where对象中的skus过滤 if (query.where?.skus && query.where.skus.length > 0) {