|
...
|
...
|
@@ -5,12 +5,16 @@ namespace App\Services\Html; |
|
|
|
|
|
|
|
use App\Models\Blog\Blog;
|
|
|
|
use App\Models\Blog\BlogCategory;
|
|
|
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
use App\Models\CustomModule\CustomModuleExtentContent;
|
|
|
|
use App\Models\Module\Module;
|
|
|
|
use App\Models\Module\ModuleCategory;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\News\NewsCategory;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\Keyword;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Template\BCustomTemplate;
|
|
|
|
use App\Models\WebSetting\WebCustom;
|
|
|
|
use App\Models\WebSetting\WebSetting;
|
|
|
|
use App\Models\WebSetting\WebSettingSeo;
|
|
...
|
...
|
@@ -32,43 +36,43 @@ class TdkService{ |
|
|
|
$phpQueryDom=phpQuery::newDocument($html);
|
|
|
|
|
|
|
|
//首页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$indexName){
|
|
|
|
if ($type == RouteMap::SOURCE_INDEX){
|
|
|
|
$tdkInfo = $this->indexTDK($project);
|
|
|
|
}
|
|
|
|
//单页面TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$pageName){
|
|
|
|
if ($type == RouteMap::SOURCE_PAGE){
|
|
|
|
$tdkInfo = $this->pageTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//自定义模块列表页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$extendCategoryName){
|
|
|
|
if ($type == RouteMap::SOURCE_MODULE_CATE){
|
|
|
|
$tdkInfo = $this->moduleCategoryTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//自定义模块详情页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$extendName){
|
|
|
|
if ($type == RouteMap::SOURCE_MODULE){
|
|
|
|
$tdkInfo = $this->moduleDetailsTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//新闻详情TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$newsName){
|
|
|
|
if ($type == RouteMap::SOURCE_NEWS){
|
|
|
|
$tdkInfo = $this->newsDetailsTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//博客详情TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$blogName){
|
|
|
|
if ($type == RouteMap::SOURCE_BLOG){
|
|
|
|
$tdkInfo = $this->blogDetailsTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//聚合页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$productKeywordName){
|
|
|
|
if ($type == RouteMap::SOURCE_PRODUCT_KEYWORD){
|
|
|
|
$tdkInfo = $this->productKeywordsTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//新闻列表页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$newsCategoryName){
|
|
|
|
if ($type == RouteMap::SOURCE_NEWS_CATE){
|
|
|
|
$tdkInfo = $this->newsCategoryTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//博客列表页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$blogCategoryName){
|
|
|
|
if ($type == RouteMap::SOURCE_BLOG_CATE){
|
|
|
|
$tdkInfo = $this->blogCategoryTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
//产品列表页TDK设置
|
|
|
|
if ($type == WebTemplateCommon::$productCategoryName){
|
|
|
|
if ($type == RouteMap::SOURCE_PRODUCT_CATE){
|
|
|
|
$tdkInfo = $this->productCategoryTDK($project,$routerMap);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -304,7 +308,7 @@ class TdkService{ |
|
|
|
public function moduleDetailsTDK($project,$routerMap): array
|
|
|
|
{
|
|
|
|
$tdkInfo = [];
|
|
|
|
$moduleInfo = Module::where("project_id",$project->id)->where("status",0)->where("id",$routerMap->source_id)->first();
|
|
|
|
$moduleInfo = CustomModuleExtentContent::where("project_id",$project->id)->where("status",0)->where("id",$routerMap->source_id)->first();
|
|
|
|
$webSetting = WebSetting::getWebSetting($project);
|
|
|
|
if (!empty($moduleInfo)){
|
|
|
|
//title
|
|
...
|
...
|
@@ -331,7 +335,7 @@ class TdkService{ |
|
|
|
public function moduleCategoryTDK($project,$routerMap): array
|
|
|
|
{
|
|
|
|
$tdkInfo = [];
|
|
|
|
$moduleCategoryInfo = ModuleCategory::getModuleCategoryAndExtendByRoute($project->id,$routerMap->route);
|
|
|
|
$moduleCategoryInfo = CustomModuleCategory::getModuleCategoryAndExtendByRoute($project->id,$routerMap->route);
|
|
|
|
$webSetting = WebSetting::getWebSetting($project);
|
|
|
|
if (!empty($moduleCategoryInfo)){
|
|
|
|
//title
|
|
...
|
...
|
@@ -359,7 +363,7 @@ class TdkService{ |
|
|
|
{
|
|
|
|
$tdkInfo = [];
|
|
|
|
if (!empty($routerMap)){
|
|
|
|
$webCustom = WebCustom::where("id",$routerMap->source_id)->where("status",1)->first();
|
|
|
|
$webCustom = BCustomTemplate::where("id",$routerMap->source_id)->where("status",1)->first();
|
|
|
|
//seo拼接
|
|
|
|
$webSeo = WebSettingSeo::where("project_id",$project->id)->first();
|
|
|
|
//网站设置
|
...
|
...
|
|