diff --git a/app/controller/CreationArticleController.php b/app/controller/CreationArticleController.php index 38e1a63..cf85bfb 100644 --- a/app/controller/CreationArticleController.php +++ b/app/controller/CreationArticleController.php @@ -38,6 +38,7 @@ class CreationArticleController public function index(CreationArticleService $service): Response { $params = requestOnly([ + 'article_category_id' => '', 'article_category' => '', 'task' => '', 'title' => '', diff --git a/app/service/CreationArticleService.php b/app/service/CreationArticleService.php index 303126d..2c8b3f5 100644 --- a/app/service/CreationArticleService.php +++ b/app/service/CreationArticleService.php @@ -70,6 +70,9 @@ class CreationArticleService extends BaseService $query = [ 'delete_time' => 0 ]; + if (isNotBlank($params['article_category_id'])) { + $query[] = ['article_category_id', '=', $params['article_category_id']]; + } if (isNotBlank($params['article_category'])) { $cids = $this->articleCategoryDao->getColumn([['name', 'like', '%' . $params['article_category'] . '%']], 'id'); $query[] = ['article_category_id', 'in', $cids];