mirror of
https://gitee.com/gz-yami/mall4j.git
synced 2026-03-22 09:17:16 +08:00
分类被禁用时,前端接口不显示
This commit is contained in:
@@ -109,7 +109,7 @@ public class CategoryController {
|
||||
@DeleteMapping("/{categoryId}")
|
||||
@PreAuthorize("@pms.hasPermission('prod:category:delete')")
|
||||
public ResponseEntity<String> delete(@PathVariable("categoryId") Long categoryId){
|
||||
if (CollectionUtil.isNotEmpty(categoryService.listByParentId(categoryId))) {
|
||||
if (categoryService.count(new LambdaQueryWrapper<Category>().eq(Category::getParentId,categoryId)) >0) {
|
||||
return ResponseEntity.badRequest().body("请删除子分类,再删除该分类");
|
||||
}
|
||||
categoryService.deleteCategroy(categoryId);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
|
||||
<select id="listByParentId" resultType="com.yami.shop.bean.model.Category">
|
||||
select category_id,category_name,`seq`,`status`,pic from tz_category where parent_id = #{parentId} order by seq
|
||||
select category_id,category_name,`seq`,`status`,pic from tz_category where parent_id = #{parentId} and `status` = 1 order by seq
|
||||
</select>
|
||||
|
||||
<select id="tableCategory" resultType="com.yami.shop.bean.model.Category">
|
||||
|
||||
Reference in New Issue
Block a user