优化页面标题seo

This commit is contained in:
2022-07-26 10:05:09 +08:00
parent ec97f2d56a
commit 6e370754a6
3 changed files with 5 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ class Index extends Common
$model_sub_category = Category::find($sub_category_id);
$page_title .= "|{$model_sub_category->title}";
$page_title .= "-{$model_sub_category->title}";
$model_post = Post::hasWhere('categorys', ['category_id' => $sub_category_id])->where('status', 1)->order('id desc');
}
} else {
@@ -71,12 +71,12 @@ class Index extends Common
if (!empty($keywords)) {
$model_post->whereLike('title|desc|content', "%$keywords%");
$page_title .= "|{$keywords}";
$page_title .= "-{$keywords}";
}
$page = $this->request->param('page', 1);
$page_title .= "|{$page}";
$page_title .= "-{$page}";
$list_post = $model_post->paginate([
'url' => 'Index/index',