refactor: 修改后台文章分类相关接口
This commit is contained in:
@@ -33,9 +33,9 @@ class ArticleCategory
|
|||||||
->order('sort', 'asc')
|
->order('sort', 'asc')
|
||||||
->select();
|
->select();
|
||||||
if (!$categorys->isEmpty()) {
|
if (!$categorys->isEmpty()) {
|
||||||
$categorys = array_to_tree($categorys, 0, 'pid', 1, false);
|
$categorys = $categorys->toArray();
|
||||||
}
|
}
|
||||||
return success('获取成功', $categorys);
|
return success('获取成功',array_to_tree($categorys, 0, 'pid', 1, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分类分页列表
|
// 分类分页列表
|
||||||
@@ -58,10 +58,10 @@ class ArticleCategory
|
|||||||
->order('sort', 'asc')
|
->order('sort', 'asc')
|
||||||
->select();
|
->select();
|
||||||
if (!$category->isEmpty()) {
|
if (!$category->isEmpty()) {
|
||||||
$category = array_to_tree($category, 0, 'pid', 1, false);
|
$category = $category->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
return success('获取成功', $category);
|
return success('获取成功', array_to_tree($category, 0, 'pid', 1, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分类详情
|
// 分类详情
|
||||||
|
|||||||
Reference in New Issue
Block a user