From 99253b7972a2a08a009bea4048ed6e8606e45ed1 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 28 Mar 2023 11:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php | 4 ++++ crmeb/app/dao/article/ArticleCategoryDao.php | 3 ++- crmeb/app/services/article/ArticleCategoryServices.php | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php b/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php index 1a666b5ac..c45019d41 100644 --- a/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php +++ b/crmeb/app/adminapi/controller/v1/cms/ArticleCategory.php @@ -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); } } diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index 275d6c9d6..dfd266a10 100644 --- a/crmeb/app/dao/article/ArticleCategoryDao.php +++ b/crmeb/app/dao/article/ArticleCategoryDao.php @@ -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'); } } diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php index 141aae62c..aff354ae6 100644 --- a/crmeb/app/services/article/ArticleCategoryServices.php +++ b/crmeb/app/services/article/ArticleCategoryServices.php @@ -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([])); } }