This commit is contained in:
李志强 2025-06-06 11:26:35 +08:00
parent 9097c77c41
commit 465fad3969

View File

@ -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';