diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index 9abee485c..275d6c9d6 100644 --- a/crmeb/app/dao/article/ArticleCategoryDao.php +++ b/crmeb/app/dao/article/ArticleCategoryDao.php @@ -32,11 +32,15 @@ class ArticleCategoryDao extends BaseDao } /** - * 获取文章列表 + * 获取文章分类列表 * @param array $where * @param int $page * @param int $limit * @return mixed + * @throws \ReflectionException + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function getList(array $where, int $page = 0, int $limit = 0) { diff --git a/crmeb/app/services/article/ArticleCategoryServices.php b/crmeb/app/services/article/ArticleCategoryServices.php index 6b11513f4..4d8957ea3 100644 --- a/crmeb/app/services/article/ArticleCategoryServices.php +++ b/crmeb/app/services/article/ArticleCategoryServices.php @@ -39,23 +39,14 @@ class ArticleCategoryServices 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 getList(array $where) { - [$page, $limit] = $this->getPageValue(); $list = $this->dao->getList($where); - if (!empty($list) && $where['title'] !== '') { - $pids = Arr::getUniqueKey($list, 'pid'); - $parentList = $this->dao->getList(['id' => $pids]); - $list = array_merge($list, $parentList); - foreach ($list as $key => $item) { - $arr = $item; - unset($list[$key]); - if (!in_array($arr, $list)) { - $list[] = $arr; - } - } - } $list = get_tree_children($list); $count = $this->dao->count($where); return compact('list', 'count');