正在显示
1 个修改的文件
包含
10 行增加
和
10 行删除
| @@ -122,17 +122,17 @@ class CustomTemplateLogic extends BaseLogic | @@ -122,17 +122,17 @@ class CustomTemplateLogic extends BaseLogic | ||
| 122 | 'project_id'=>$this->user['project_id'], | 122 | 'project_id'=>$this->user['project_id'], |
| 123 | 'source'=>1//首页 | 123 | 'source'=>1//首页 |
| 124 | ]); | 124 | ]); |
| 125 | - if($TemplateInfo === false){ | ||
| 126 | - $this->fail('请先装修首页'); | ||
| 127 | - } | ||
| 128 | - if(empty($preg_html)){ | ||
| 129 | - $preg_html = "<main></main>"; | ||
| 130 | - $html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s', "<style id='globalsojs-styles'></style>", $TemplateInfo['html']); | ||
| 131 | - }else{ | ||
| 132 | - $html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s',$html_style , $TemplateInfo['html']); | 125 | + $html = ''; |
| 126 | + if($TemplateInfo !== false){ | ||
| 127 | + if(empty($preg_html)){ | ||
| 128 | + $preg_html = "<main></main>"; | ||
| 129 | + $html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s', "<style id='globalsojs-styles'></style>", $TemplateInfo['html']); | ||
| 130 | + }else{ | ||
| 131 | + $html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s',$html_style , $TemplateInfo['html']); | ||
| 132 | + } | ||
| 133 | + //内容 | ||
| 134 | + $html = preg_replace('/<main\b[^>]*>(.*?)<\/main>/s', $preg_html, $html); | ||
| 133 | } | 135 | } |
| 134 | - //内容 | ||
| 135 | - $html = preg_replace('/<main\b[^>]*>(.*?)<\/main>/s', $preg_html, $html); | ||
| 136 | return $html; | 136 | return $html; |
| 137 | } | 137 | } |
| 138 | 138 |
-
请 注册 或 登录 后发表评论