From 03f26e9257af4db60f00f11b2ecd301d15cc3e1f Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 28 Jun 2023 09:57:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/file/SystemAttachmentCategory.php | 6 +++++- .../attachment/SystemAttachmentCategoryServices.php | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/file/SystemAttachmentCategory.php b/crmeb/app/adminapi/controller/v1/file/SystemAttachmentCategory.php index c04f1b913..9095b6694 100644 --- a/crmeb/app/adminapi/controller/v1/file/SystemAttachmentCategory.php +++ b/crmeb/app/adminapi/controller/v1/file/SystemAttachmentCategory.php @@ -38,7 +38,11 @@ class SystemAttachmentCategory extends AuthController /** * 显示资源列表 - * @return mixed + * @return \think\Response + * @throws \ReflectionException + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function index() { diff --git a/crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php b/crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php index e0f043cff..9d69b39f9 100644 --- a/crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php +++ b/crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php @@ -41,14 +41,20 @@ class SystemAttachmentCategoryServices extends BaseServices * 获取分类列表 * @param array $where * @return array + * @throws \ReflectionException + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function getAll(array $where) { $list = $this->dao->getList($where); foreach ($list as &$item) { $item['title'] = $item['name']; - $item['children'] = []; - if ($where['name'] == '' && $this->dao->count(['pid' => $item['id']])) $item['loading'] = false; + if ($where['name'] == '' && $this->dao->count(['pid' => $item['id']])) { + $item['loading'] = false; + $item['children'] = []; + } } return compact('list'); }