|
...
|
...
|
@@ -333,11 +333,17 @@ class BTemplateLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/13 17:02
|
|
|
|
*/
|
|
|
|
public function saveHtml($html,$source,$source_id,$template_id = 0,$is_custom = 0){
|
|
|
|
public function saveHtml($html,$source,$source_id,$section_list_id,$template_id = 0,$is_custom = 0){
|
|
|
|
$this->saveCommonHtml($html,$source,$source_id,$template_id);//保存头部底部
|
|
|
|
$info = $this->webTemplateInfo($this->param['template_id'],$source,$source_id,$is_custom);
|
|
|
|
$handleInfo = $this->handleTemplateParam($html);
|
|
|
|
if($info === false){
|
|
|
|
$data = [];
|
|
|
|
//TODO::查看当前界面是否为定制界面
|
|
|
|
$data = [
|
|
|
|
'source'=>$source,'source_id'=>$source_id,'section_list_id'=>$section_list_id,
|
|
|
|
'template_id'=>$template_id, 'project_id'=>$this->user['project_id'],
|
|
|
|
'main_html'=>$handleInfo['main_html'],'main_css'=>$handleInfo['main_css']
|
|
|
|
];
|
|
|
|
$this->model->add($data);
|
|
|
|
}else{
|
|
|
|
$data = [];
|
|
...
|
...
|
@@ -448,7 +454,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存时字符串处理
|
|
|
|
* @name :handleSaveParam
|
|
|
|
* @name :handleCommonParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/29 15:35
|
|
...
|
...
|
@@ -465,6 +471,19 @@ class BTemplateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存时字符串处理
|
|
|
|
* @name :handleSaveParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/29 15:35
|
|
|
|
*/
|
|
|
|
public function handleTemplateParam($html){
|
|
|
|
//字符串截取
|
|
|
|
$param['main_html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
$param['main_css'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
return $this->success($param);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :获取设置的类型
|
|
|
|
* @name :getType
|
|
|
|
* @author :lyh
|
...
|
...
|
|