作者 lyh

gx

... ... @@ -64,7 +64,8 @@ class BTemplateLogLogic extends BaseLogic
if(!empty($info['other'])){
$commonTemplateModel->edit(['other'=>$info['other']],['project_id'=>$this->user['project_id'],'template_id'=>$info['template_id']]);
}else{
$other = str_replace('<header','',characterTruncation($info['text'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));
$footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s'));
$other = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);
$commonTemplateModel->edit(['other'=>$other],['project_id'=>$this->user['project_id'],'template_id'=>$info['template_id']]);
}
}catch (\Exception $e){
... ... @@ -118,7 +119,8 @@ class BTemplateLogLogic extends BaseLogic
$this->fail('当前数据不存在,或已被删除');
}
if(empty($info['other'])){
$info['other'] = str_replace('<header','',characterTruncation($info['text'],"/<link id=\"google-fonts-link\"(.*?)<header/s"));
$footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s'));
$info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);
}
$html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other'].
$info['head_html'].$info['main_html'].$info['footer_html'];
... ...
... ... @@ -152,7 +152,6 @@ class CustomTemplateLogic extends BaseLogic
*/
public function saveCommonTemplate($html,$template_id){
$type = $this->getType();
$templateCommonModel = new BTemplateCommon();
$info = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type]);
$data = [
... ...