app默认不传参查商城商品
This commit is contained in:
1 parent
d1539a8b5b
commit
67d3247d80
1 file changed
+4
-2
+4
-2
@@ -87,13 +87,15 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
|
||||
* 获得商品 SPU 分页,提供给用户 App 使用
|
||||
*/
|
||||
default PageResult<ProductSpuDO> selectPage(AppProductSpuPageReqVO pageReqVO, Set<Long> categoryIds) {
|
||||
// App 端默认只查“商城商品”(types=0)。避免不传 types 时把提货柜/售货机商品一起查出来
|
||||
int types = ObjectUtil.defaultIfNull(pageReqVO.getTypes(), ProductSpuTypesEnum.DISABLE.getTypes());
|
||||
LambdaQueryWrapperX<ProductSpuDO> query = new LambdaQueryWrapperX<ProductSpuDO>()
|
||||
//根据创建人查询商品
|
||||
// .eqIfPresent(ProductSpuDO::getCreator, pageReqVO.getCreator())
|
||||
//根据设备id查询商品
|
||||
.eqIfPresent(ProductSpuDO::getDeviceId, pageReqVO.getDeviceId())
|
||||
//根据类型查询商品
|
||||
.eqIfPresent(ProductSpuDO::getTypes, pageReqVO.getTypes())
|
||||
//根据类型查询商品(默认商城商品)
|
||||
.eq(ProductSpuDO::getTypes, types)
|
||||
// 热门推荐
|
||||
.eq(pageReqVO.getHotRecommend() != null, ProductSpuDO::getHotRecommend, pageReqVO.getHotRecommend())
|
||||
// 关键字匹配,目前只匹配商品名
|
||||
|
||||
Reference in new issue
Block a user