作者 赵彬吉

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -40,6 +40,7 @@ class BTemplateLogLogic extends BaseLogic @@ -40,6 +40,7 @@ class BTemplateLogLogic extends BaseLogic
40 } 40 }
41 $bTemplateModel = new BTemplate(); 41 $bTemplateModel = new BTemplate();
42 if($info['template_id'] == 0){//定制项目 42 if($info['template_id'] == 0){//定制项目
  43 + //TODO::还原头部+底部
43 $bTemplateModel->edit(['html'=>$info['text']],['template_id'=>$info['template_id'],'source'=>$info['source'],'source_id'=>$info['source_id']]); 44 $bTemplateModel->edit(['html'=>$info['text']],['template_id'=>$info['template_id'],'source'=>$info['source'],'source_id'=>$info['source_id']]);
44 return $this->success(); 45 return $this->success();
45 } 46 }
@@ -121,23 +122,31 @@ class BTemplateLogLogic extends BaseLogic @@ -121,23 +122,31 @@ class BTemplateLogLogic extends BaseLogic
121 if($info === false){ 122 if($info === false){
122 $this->fail('当前数据不存在,或已被删除'); 123 $this->fail('当前数据不存在,或已被删除');
123 } 124 }
124 - if(empty($info['other'])){  
125 - $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s'));  
126 - $info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);  
127 - }  
128 - $html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other'].  
129 - $info['head_html'].$info['main_html'].$info['footer_html'];  
130 - $serviceSettingModel = new ServiceSettingModel();  
131 - $list = $serviceSettingModel->list(['type'=>2],'created_at');  
132 - //拼接html  
133 - foreach ($list as $v){  
134 - if($v['key'] == 'head'){  
135 - $html = $v['values'].$html; 125 + if($this->user['is_customized'] != BTemplate::IS_VISUALIZATION){
  126 + if(empty($info['other'])){
  127 + $footer_other = str_replace('<header','',characterTruncation($info['text'],'/<style id="globalsojs-footer">(.*?)<header/s'));
  128 + $info['other'] = preg_replace('/<style id="globalsojs-footer">(.*?)<\/style>/s', '', $footer_other);
136 } 129 }
137 - if($v['key'] == 'footer'){  
138 - $html = $html.$v['values']; 130 + $html = $info['head_css'].$info['main_css'].$info['footer_css'].$info['other'].
  131 + $info['head_html'].$info['main_html'].$info['footer_html'];
  132 + $serviceSettingModel = new ServiceSettingModel();
  133 + $list = $serviceSettingModel->list(['type'=>2],'created_at');
  134 + //拼接html
  135 + foreach ($list as $v){
  136 + if($v['key'] == 'head'){
  137 + $html = $v['values'].$html;
  138 + }
  139 + if($v['key'] == 'footer'){
  140 + $html = $html.$v['values'];
  141 + }
  142 + }
  143 + }else{
  144 + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
  145 + if (in_array(1, $page_array)) {//首页是定制界面
  146 + $html = $info['text'];
139 } 147 }
140 } 148 }
141 return $this->success(['html'=>$html]); 149 return $this->success(['html'=>$html]);
142 } 150 }
  151 +
143 } 152 }