feat: 完善seo

master
yin5th 2023-07-26 16:02:37 +08:00
parent e856ed9f30
commit f8cad89fef
5 changed files with 7 additions and 7 deletions

View File

@ -27,7 +27,7 @@ class About extends Base
$this->data['leaderList'] = $leaderList; $this->data['leaderList'] = $leaderList;
$this->data['honorList'] = $honorList; $this->data['honorList'] = $honorList;
$this->setSeo($this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']); $this->setSeo($category['title'].'|'.$this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
return $this->view(); return $this->view();
} }
} }

View File

@ -11,6 +11,8 @@ class Contact extends Base
$categoryId = Category::CATEGORY_CONTACT; $categoryId = Category::CATEGORY_CONTACT;
$category = Category::where('id', $categoryId)->find(); $category = Category::where('id', $categoryId)->find();
$this->setSeo($category['title'].'|'.$this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
$this->data['category'] = $category; $this->data['category'] = $category;
return $this->view(); return $this->view();
} }

View File

@ -24,7 +24,7 @@ class Index extends Base
// $this->data['category'] = $category; // $this->data['category'] = $category;
$this->data['isIndex'] = true; $this->data['isIndex'] = true;
$this->setSeo($this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']); $this->setSeo('首页|'.$this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
return $this->view(); return $this->view();
} }

View File

@ -111,7 +111,6 @@ class Info extends Base
$keywords = $category['seo_keywords'] ?: $this->system['seo_keywords']; $keywords = $category['seo_keywords'] ?: $this->system['seo_keywords'];
$title = $category['seo_title'] ?: $category['title'] . ' | ' . $this->system['seo_title']; $title = $category['seo_title'] ?: $category['title'] . ' | ' . $this->system['seo_title'];
$this->setSeo($title, $keywords, $description); $this->setSeo($title, $keywords, $description);
$listSort = ['a.sort' => 'desc'];
$cateList = Category::where('parent_id', $category['id']) $cateList = Category::where('parent_id', $category['id'])
->where('model_id', 39)//公式公告 ->where('model_id', 39)//公式公告
@ -122,7 +121,6 @@ class Info extends Base
$list = []; $list = [];
foreach ($cateList as &$cate) { foreach ($cateList as &$cate) {
// $list[$cate['id']]['total'] = NoticeModel::getList($cate['id'], 2, $keyword, [], 1, $listSort, false);
$cate['total'] = NoticeModel::where('category_id', $cate['id'])->when(!empty($keyword), function ($q) use ($keyword) { $cate['total'] = NoticeModel::where('category_id', $cate['id'])->when(!empty($keyword), function ($q) use ($keyword) {
$q->where('title', 'like', '%'.$keyword.'%'); $q->where('title', 'like', '%'.$keyword.'%');
})->count(); })->count();

View File

@ -21,7 +21,7 @@ return array (
'info_tel' => '0817-5082666(办公室)', 'info_tel' => '0817-5082666(办公室)',
'info_email' => 'XXXXXXXX@XXX.com', 'info_email' => 'XXXXXXXX@XXX.com',
'info_address' => 'XXXXXXXXXXXXX', 'info_address' => 'XXXXXXXXXXXXX',
'seo_title' => '111', 'seo_title' => '四川蓬州产业投资集团有限责任公司',
'seo_keywords' => '222', 'seo_keywords' => '蓬安农业|工业|旅游业|蓬安投资|蓬安开发|蓬安建设|蓬安营运',
'seo_description' => '333', 'seo_description' => '产投集团聚焦蓬安农业、工业、旅游业三产业的投资、开发、建设、营运,主要从事国有资本营运管理、产业资本营运管理、产业金融服务,农业综合开发、产业园区开发、旅游资源开发、文化体育及相关领域投资,推动国有经济战略布局调整、产业结构优化、产业转型升级。',
); );