|
@@ -94,16 +94,16 @@ export class WebService {
|
|
|
// 递归查找顶层父分类
|
|
|
while (currentCategory.parent) {
|
|
|
currentCategory = await this.categoryRepo.findOne({
|
|
|
- where: { id: currentCategory.parent.id },
|
|
|
+ where: { id: currentCategory.parent.id, enable: true },
|
|
|
relations: { parent: true },
|
|
|
});
|
|
|
}
|
|
|
console.log('currentCategory', currentCategory);
|
|
|
return currentCategory.id
|
|
|
? this.categoryRepo.findOne({
|
|
|
- where: { id: currentCategory.id, enable: true },
|
|
|
- relations: { children: true },
|
|
|
- })
|
|
|
+ where: { id: currentCategory.id, enable: true },
|
|
|
+ relations: { children: true },
|
|
|
+ })
|
|
|
: null;
|
|
|
}
|
|
|
|
|
@@ -162,7 +162,7 @@ export class WebService {
|
|
|
|
|
|
// 保留
|
|
|
const category = await this.categoryRepo.findOne({
|
|
|
- where: { id: id },
|
|
|
+ where: { id: id, enable: true },
|
|
|
relations: { children: true },
|
|
|
});
|
|
|
const ids = await this.findCateAllChildIds(category.id);
|