|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :UpdateHtml.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 10:11
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Html;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Models\Com\NoticeLog;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class UpdateHtml extends Controller
|
|
|
|
{
|
|
|
|
protected $param;
|
|
|
|
protected $project_id;
|
|
|
|
public function __construct($data){
|
|
|
|
$this->param = $data;//Todo::传递的参数
|
|
|
|
$this->project_id = $data['project_id'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :更新界面
|
|
|
|
* @name :updateHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 10:12
|
|
|
|
*/
|
|
|
|
public function updateHtml(){
|
|
|
|
ProjectServer::useProject($this->project_id);
|
|
|
|
if(isset($this->param['route']) && $this->param['route'] == 'all'){
|
|
|
|
//TODO::更新所有界面
|
|
|
|
}else{
|
|
|
|
//TODO::更新单页
|
|
|
|
$routeMapModel = new RouteMap();
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取页面是否为 定制/非定制 页面
|
|
|
|
* @name :getPageHtmlIsCustomized
|
|
|
|
* @param :source:类型;is_list:是否为列表页 1:列表页面
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 11:03
|
|
|
|
*/
|
|
|
|
public function getPageHtmlIsCustomized($source,$is_list){
|
|
|
|
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
|
|
|
|
//查看当前页面是否定制,是否开启可视化
|
|
|
|
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
|
|
|
|
if (in_array($type, $page_array)) {//是定制界面
|
|
|
|
return BTemplate::IS_VISUALIZATION;
|
|
|
|
}
|
|
|
|
return BTemplate::IS_NO_VISUALIZATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取头部底部公共部分代码
|
|
|
|
* @name :getTemplateCommon
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 11:02
|
|
|
|
*/
|
|
|
|
public function getTemplateCommon(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取装修中间内容
|
|
|
|
* @name :getTemplateMainHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 11:01
|
|
|
|
*/
|
|
|
|
public function getTemplateMainHtml(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取项目详情
|
|
|
|
* @name :getProjectInfo
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/2/2 10:50
|
|
|
|
*/
|
|
|
|
public function getProjectInfo($project_id){
|
|
|
|
$projectModel = new Project();
|
|
|
|
$info = $projectModel->read(['id'=>$project_id],['id','is_customized']);
|
|
|
|
return $info;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :拼接获取公共头部底部
|
|
|
|
* @name :getHeadFooter
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/21 17:22
|
|
|
|
*/
|
|
|
|
public function getHeadFooter($html){
|
|
|
|
//获取公共主题头部底部
|
|
|
|
$serviceSettingModel = new ServiceSettingModel();
|
|
|
|
$list = $serviceSettingModel->list(['type'=>2],'created_at');
|
|
|
|
//拼接html
|
|
|
|
foreach ($list as $v){
|
|
|
|
if($v['key'] == 'head'){
|
|
|
|
$html = $v['values'].$html;
|
|
|
|
}
|
|
|
|
if($v['key'] == 'footer'){
|
|
|
|
$html = $html.$v['values'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|