作者 lyh

gx

... ... @@ -40,6 +40,7 @@ class BTemplateLogLogic extends BaseLogic
}
$bTemplateModel = new BTemplate();
if($info['template_id'] == 0){//定制项目
//TODO::还原头部+底部
$bTemplateModel->edit(['html'=>$info['text']],['template_id'=>$info['template_id'],'source'=>$info['source'],'source_id'=>$info['source_id']]);
return $this->success();
}
... ... @@ -121,23 +122,31 @@ class BTemplateLogLogic extends BaseLogic
if($info === false){
$this->fail('当前数据不存在,或已被删除');
}
if(empty($info['other'])){
$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'];
$serviceSettingModel = new ServiceSettingModel();
$list = $serviceSettingModel->list(['type'=>2],'created_at');
//拼接html
foreach ($list as $v){
if($v['key'] == 'head'){
$html = $v['values'].$html;
if($this->user['is_customized'] != BTemplate::IS_VISUALIZATION){
if(empty($info['other'])){
$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);
}
if($v['key'] == 'footer'){
$html = $html.$v['values'];
$html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other'].
$info['head_html'].$info['main_html'].$info['footer_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'];
}
}
}else{
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
if (in_array(1, $page_array)) {//首页是定制界面
$html = $info['text'];
}
}
return $this->success(['html'=>$html]);
}
}
... ...