@@ -165,10 +165,14 @@ class ArticleCategory extends AuthController
/**
* 树形列表
* @return mixed
+ * @throws \ReflectionException
*/
public function getTreeList()
{
$list = $this->service->getTreeList();
+ foreach ($list as &$item) {
+ $item['disabled'] = !$item['status'] || $item['is_del'];
+ }
return app('json')->success($list);
}
@@ -86,9 +86,10 @@ class ArticleCategoryDao extends BaseDao
* 添加修改选择上级分类列表
* @param array $where
* @return array
public function getMenus(array $where)
- return $this->search($where)->order('sort desc,id desc')->column('title,pid,id');
+ return $this->search($where)->order('sort desc,id desc')->column('title,pid,id,is_del,status');
@@ -151,10 +151,10 @@ class ArticleCategoryServices extends BaseServices
- $where['status'] = 1;
- return sort_list_tier($this->dao->getMenus($where));
+ return sort_list_tier($this->dao->getMenus([]));