作者 lyh

gx

... ... @@ -110,7 +110,7 @@ class CustomTemplateLogic extends BaseLogic
* @method :post
* @time :2023/10/13 14:27
*/
public function saveCommonTemplate($param){
public function saveCommonTemplate($html){
$type = $this->getType();
$templateCommonModel = new BTemplateCommon();
//获取设置的默认模版
... ... @@ -118,11 +118,11 @@ class CustomTemplateLogic extends BaseLogic
$bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
$info = $templateCommonModel->read(['template_id'=>$bSettingInfo['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
$data = [
'head_html'=>characterTruncation($param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'),
'head_css'=>characterTruncation($param['html'],'/<style id="globalsojs-header">(.*?)<\/style>/s'),
'footer_html'=>characterTruncation($param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'),
'footer_css'=>characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
'head_html'=>characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s'),
'head_css'=>characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s'),
'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'),
'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
'other'=>str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")),
];
if($info === false){
$data['template_id'] = $bSettingInfo['template_id'];
... ...