作者 lyh

gx

<?php
/**
* @remark :
* @name :UpdateRoute.php
* @author :lyh
* @method :post
* @time :2023/11/20 15:07
*/
namespace App\Console\Commands;
use App\Models\Blog\Blog;
use App\Models\Blog\BlogCategory;
use App\Models\News\News;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
/**
* @remark :更新所有项目的路由
* @name :UpdateRoute
* @author :lyh
* @method :post
* @time :2023/11/20 15:08
*/
class UpdateMainHtml extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update_main';
/**
* The console command description.
*
* @var string
*/
protected $description = '洗数据';
/**
* @remark :统一更新路由
* @name :handle
* @author :lyh
* @method :post
* @time :2023/11/20 15:13
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['is_upgrade'=>0]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
/**
* @remark :洗数据
* @name :getMainHtml
* @author :lyh
* @method :post
* @time :2023/12/27 18:03
*/
public function editMainHtml(){
}
}
... ...
... ... @@ -80,14 +80,14 @@ class BTemplateLogic extends BaseLogic
$mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码
}else{
if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码
$type = $this->getHeaderType($this->param['source'], $is_list);//获取头部底部类型
$type = $this->getCustomizedType($this->param['source'], $is_list);//获取头部底部类型
$commonInfo = $this->getCommonHtml($type,$is_list,0);//获取定制头部
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
}
$mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
}
$type = $this->getHeaderType($this->param['source'], $is_list);//获取头部底部类型
$type = $this->getCustomizedType($this->param['source'], $is_list);//获取头部底部类型
$commonInfo = $this->getCommonHtml($type,$is_list,$template_id);//获取定制头部
$html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other'].
$commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html'];
... ... @@ -184,43 +184,7 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :独立头部获取头部底部类型
* @name :getHeaderType
* @author :lyh
* @method :post
* @time :2023/12/27 11:36
*/
public function getHeaderType($type,$is_list){
$resultType = BTemplate::SOURCE_HOME;
if($type == BTemplate::SOURCE_PRODUCT){
if($is_list == BTemplate::IS_LIST){
$resultType = BTemplate::TYPE_THREE;
}else{
$resultType = BTemplate::TYPE_TWO;
}
}
if($type == BTemplate::SOURCE_BLOG){
if($is_list == BTemplate::IS_LIST){
$resultType = BTemplate::TYPE_FIVE;
}else{
$resultType = BTemplate::TYPE_FOUR;
}
}
if($type == BTemplate::SOURCE_NEWS){
if($is_list == BTemplate::IS_LIST){
$resultType = BTemplate::TYPE_SEVEN;
}else{
$resultType = BTemplate::TYPE_SIX;
}
}
if($type == BTemplate::SOURCE_KEYWORD){
$resultType = BTemplate::TYPE_EIGHT;
}
return $this->success($resultType);
}
/**
* @remark :定制界面根据source获取type类型
* @remark :根据source获取type类型
* @name :getType
* @author :lyh
* @method :post
... ...