diff --git a/app/index/controller/SearchController.php b/app/index/controller/SearchController.php index 9c9e44f..3e9b0e1 100644 --- a/app/index/controller/SearchController.php +++ b/app/index/controller/SearchController.php @@ -13,7 +13,7 @@ class SearchController extends BaseController public function index() { $keyword = input('keyword', ''); - $type = input('type', 'articles'); // 搜索类型:article-文章,resource-资源 + $type = input('type', 'articles'); // 搜索类型:articles-文章,resources-资源 $page = input('page', 1); $limit = input('limit', 10); @@ -29,7 +29,7 @@ class SearchController extends BaseController $categoryUrl = '/index/articles/category'; $status = 2; // 文章状态为2 $fields = 'id, title, cate, image, author, FROM_UNIXTIME(create_time, "%Y-%m-%d") as publishdate'; - } else if ($type == 'resource') { + } else if ($type == 'resources') { $model = new Resources(); $categoryModel = new ResourcesCategory(); $detailUrl = '/index/resources/detail';