|
...
|
...
|
@@ -223,13 +223,21 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
if($info === false){
|
|
|
|
$this->fail('请先设置模版');
|
|
|
|
}
|
|
|
|
//兼容老数据
|
|
|
|
|
|
|
|
$commonTemplateModel = new BTemplateCommon();
|
|
|
|
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id']]);
|
|
|
|
$html = '';
|
|
|
|
if($commonInfo !== false){
|
|
|
|
$html = $commonInfo['head_css'].$html_style.$commonInfo['footer_css'].$commonInfo['other'].
|
|
|
|
$commonInfo['head_html'].$preg_html.$commonInfo['footer_html'];
|
|
|
|
}else{
|
|
|
|
//兼容老数据,获取首页数据
|
|
|
|
$TemplateInfo = $this->webTemplateInfo($info['template_id'],1,0);
|
|
|
|
if($TemplateInfo !== false){
|
|
|
|
$html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s',$html_style , $TemplateInfo['html']);
|
|
|
|
//内容
|
|
|
|
$html = preg_replace('/<main\b[^>]*>(.*?)<\/main>/s', $preg_html, $html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $html;
|
|
|
|
}
|
...
|
...
|
|