From 7613f6b73a96039ea400aeba3d63c15ffaf04795 Mon Sep 17 00:00:00 2001 From: rentaiming <806181062@qq.com> Date: 星期三, 12 六月 2024 17:34:05 +0800 Subject: [PATCH] 用户端商品 --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java index 553a71f..dfcc88f 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/GoodsSeckillServiceImpl.java @@ -249,12 +249,21 @@ LambdaQueryWrapper<GoodsSku> wrapper3= Wrappers.lambdaQuery(); wrapper3.eq(GoodsSku::getDelFlag,0); wrapper3.eq(GoodsSku::getListingStatus,0); - wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); - wrapper3.eq(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); - wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); - wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); - wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); - wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); + if (homeGoodsSkuDTO.getSkuName()!=null){ + wrapper3.like(GoodsSku::getSkuName,homeGoodsSkuDTO.getSkuName()); + } + if (homeGoodsSkuDTO.getBrandId()!=null){ + wrapper3.eq(GoodsSku::getBrandId,homeGoodsSkuDTO.getBrandId()); + } + if (homeGoodsSkuDTO.getCategoryId()!=null){ + wrapper3.eq(GoodsSku::getCategoryId,homeGoodsSkuDTO.getCategoryId()); + } + if (homeGoodsSkuDTO.getSeriesId()!=null){ + wrapper3.eq(GoodsSku::getSeriesId,homeGoodsSkuDTO.getSeriesId()); + } + if (homeGoodsSkuDTO.getFlavorTypeId()!=null){ + wrapper3.eq(GoodsSku::getFlavorTypeId,homeGoodsSkuDTO.getFlavorTypeId()); + } if (homeGoodsSkuDTO.getSort()==2){ wrapper3.orderByAsc(GoodsSku::getPrice); } -- Gitblit v1.7.1