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