添加的文章回显问题修复

This commit is contained in:
evoxwht 2023-03-28 11:58:44 +08:00
parent 72653993c3
commit 99253b7972
3 changed files with 8 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -86,9 +86,10 @@ class ArticleCategoryDao extends BaseDao
* 添加修改选择上级分类列表
* @param array $where
* @return array
* @throws \ReflectionException
*/
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');
}
}

View File

@ -151,10 +151,10 @@ class ArticleCategoryServices extends BaseServices
/**
* 树形列表
* @return array
* @throws \ReflectionException
*/
public function getTreeList()
{
$where['status'] = 1;
return sort_list_tier($this->dao->getMenus($where));
return sort_list_tier($this->dao->getMenus([]));
}
}