evoxwht пре 2 година
родитељ
комит
5364f2d229

+ 5 - 1
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)
     {

+ 4 - 13
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');