修复分类查询

This commit is contained in:
zjf committed 2025-09-09 15:44:45 +08:00
1 parent fa8f937b14
commit 904b2d862d
1 file changed
+2 -2
@@ -71,7 +71,7 @@ public class MallAppController {
@Operation(summary = "获取分类树", description = "获取所有分类的树结构")
public R<List<MallCategoryTreeVo>> getCategoryTree(@RequestParam(required = false) Long merchantId) {
LambdaQueryWrapper<MallCategoryEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(MallCategoryEntity::getStatus, 1); // 只查启用状态
wrapper.eq(MallCategoryEntity::getStatus, MallConstants.Status.ENABLED); // 只查启用状态
// 添加商户ID过滤条件
wrapper.eq(merchantId != null, MallCategoryEntity::getMerchantId, merchantId);
List<MallCategoryEntity> all = mallCategoryService.list(wrapper);
@@ -87,7 +87,7 @@ public class MallAppController {
public R<List<MallCategoryEntity>> getCategoryListByParent(@PathVariable("parentId") Long parentId, @RequestParam(required = false) Long merchantId) {
LambdaQueryWrapper<MallCategoryEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(MallCategoryEntity::getParentId, parentId);
wrapper.eq(MallCategoryEntity::getStatus, 1);
wrapper.eq(MallCategoryEntity::getStatus, MallConstants.Status.ENABLED);
// 添加商户ID过滤条件
wrapper.eq(merchantId != null, MallCategoryEntity::getMerchantId, merchantId);
List<MallCategoryEntity> list = mallCategoryService.list(wrapper);