获取分类递归复杂度优化
This commit is contained in:
@ -165,6 +165,7 @@ public class StoreProductController {
|
||||
//商品分类
|
||||
List<YxStoreCategory> storeCategories = yxStoreCategoryService.lambdaQuery()
|
||||
.eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
|
||||
.orderByAsc(YxStoreCategory::getPid)
|
||||
.list();
|
||||
|
||||
List<Map<String,Object>> cateList = new ArrayList<>();
|
||||
@ -265,8 +266,13 @@ public class StoreProductController {
|
||||
data.remove(i);
|
||||
|
||||
i--;
|
||||
if(storeCategory.getPid() > 0){
|
||||
this.makeCate(data,cateList,storeCategory.getPid(),level);
|
||||
}else{
|
||||
this.makeCate(data,cateList,storeCategory.getId(),level + 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user