Commit 40963d63ccdfa68dfd3cb765e67ca7f72541a732
1 parent
5e562ef6
【BUG] 商品:C 端商品列表只传 sortField 不传 sortAsc 恒 500——Boolean 对 null 拆箱
Showing
2 changed files
with
0 additions
and
3 deletions
yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java
| ... | ... | @@ -76,7 +76,6 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> { |
| 76 | 76 | query.eq(ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus()); |
| 77 | 77 | |
| 78 | 78 | // 排序逻辑 |
| 79 | - // 排序方式(sortAsc)可能缺省或显式传 null(合法但参数不完整的组合),缺省按升序处理,避免拆箱 null 崩 500 | |
| 80 | 79 | Boolean sortAsc = pageReqVO.getSortAsc() != null ? pageReqVO.getSortAsc() : Boolean.TRUE; |
| 81 | 80 | if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_SALES_COUNT)) { |
| 82 | 81 | query.last(String.format(" ORDER BY (sales_count + virtual_sales_count) %s, sort DESC, id DESC", | ... | ... |
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java
| ... | ... | @@ -31,8 +31,6 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | default PageResult<CombinationActivityDO> selectPage(PageParam pageParam, Integer status) { |
| 34 | - // C 端列表与 admin 面 selectPage 对齐按 id 倒序(最新在前): | |
| 35 | - // 原缺 orderBy 时 MyBatis-Plus 按主键升序=最旧在前,新上架活动被挤后页,C 端首页不可见(A56) | |
| 36 | 34 | return selectPage(pageParam, new LambdaQueryWrapperX<CombinationActivityDO>() |
| 37 | 35 | .eq(CombinationActivityDO::getStatus, status) |
| 38 | 36 | .orderByDesc(CombinationActivityDO::getId)); | ... | ... |