正在显示
1 个修改的文件
包含
0 行增加
和
107 行删除
| @@ -212,21 +212,6 @@ class BTemplateLogic extends BaseLogic | @@ -212,21 +212,6 @@ class BTemplateLogic extends BaseLogic | ||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | /** | 214 | /** |
| 215 | - * @remark :查看首页是否可视化 | ||
| 216 | - * @name :getTemplateHtml | ||
| 217 | - * @author :lyh | ||
| 218 | - * @method :post | ||
| 219 | - * @time :2023/12/13 9:50 | ||
| 220 | - */ | ||
| 221 | - public function homeISVisualization($template_id){ | ||
| 222 | - $homeTemplateInfo = $this->webTemplateInfo($template_id,BTemplate::SOURCE_HOME,0); | ||
| 223 | - if($homeTemplateInfo === false){ | ||
| 224 | - $this->fail('请先装修首页'); | ||
| 225 | - } | ||
| 226 | - return $this->success($homeTemplateInfo); | ||
| 227 | - } | ||
| 228 | - | ||
| 229 | - /** | ||
| 230 | * @remark :根据参数获取数据详情 | 215 | * @remark :根据参数获取数据详情 |
| 231 | * @name :webTemplateInfo | 216 | * @name :webTemplateInfo |
| 232 | * @author :lyh | 217 | * @author :lyh |
| @@ -246,98 +231,6 @@ class BTemplateLogic extends BaseLogic | @@ -246,98 +231,6 @@ class BTemplateLogic extends BaseLogic | ||
| 246 | } | 231 | } |
| 247 | 232 | ||
| 248 | /** | 233 | /** |
| 249 | - * @remark :处理首页数据 | ||
| 250 | - * @name :homeHtml | ||
| 251 | - * @author :lyh | ||
| 252 | - * @method :post | ||
| 253 | - * @time :2023/7/25 16:36 | ||
| 254 | - */ | ||
| 255 | - public function homeHtml($info,$source,$source_id){ | ||
| 256 | - //查看当前模板是否已编辑保存web_template | ||
| 257 | - $TemplateInfo = $this->webTemplateInfo($info['template_id'],$source,$source_id); | ||
| 258 | - if($TemplateInfo === false){ | ||
| 259 | - //获取模板详情 | ||
| 260 | - $ATemplateModel = new Template(); | ||
| 261 | - $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]); | ||
| 262 | - }else{ | ||
| 263 | - $commonTemplateModel = new BTemplateCommon(); | ||
| 264 | - $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]); | ||
| 265 | - $TemplateInfo['html'] = $commonInfo['head_css'].$TemplateInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. | ||
| 266 | - $commonInfo['head_html'].$TemplateInfo['main_html'].$commonInfo['footer_html']; | ||
| 267 | - $ATemplateModel = new Template(); | ||
| 268 | - $ATemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']],['name','image']); | ||
| 269 | - $TemplateInfo['name'] = $ATemplateInfo['name']; | ||
| 270 | - $TemplateInfo['image_link'] = getImageUrl($ATemplateInfo['image']); | ||
| 271 | - } | ||
| 272 | - $TemplateInfo['html'] = $this->getHeadFooter($TemplateInfo['html']); | ||
| 273 | - return $this->success($TemplateInfo); | ||
| 274 | - } | ||
| 275 | - | ||
| 276 | - /** | ||
| 277 | - * @remark :处理其他页数据 | ||
| 278 | - * @name :ProductHtml | ||
| 279 | - * @author :lyh | ||
| 280 | - * @method :post | ||
| 281 | - * @time :2023/7/25 16:40 | ||
| 282 | - */ | ||
| 283 | - public function otherHtml($info,$source,$source_id){ | ||
| 284 | - $homeTemplateInfo = $this->webTemplateInfo($info['template_id'],1,0); | ||
| 285 | - if($homeTemplateInfo === false){ | ||
| 286 | - $this->fail('请先装修首页'); | ||
| 287 | - } | ||
| 288 | - //查看当前模板是否已编辑保存web_template | ||
| 289 | - $TemplateInfo = $this->webTemplateInfo($info['template_id'],$source,$source_id); | ||
| 290 | - if($TemplateInfo === false){ | ||
| 291 | - $mainInfo = $this->getCommonMain($source,$source_id); | ||
| 292 | - $main_html = $mainInfo['main_html']; | ||
| 293 | - $main_style = $mainInfo['main_css']; | ||
| 294 | - $TemplateInfo['template_id'] = $info['template_id']; | ||
| 295 | - }else{ | ||
| 296 | - $main_html = $TemplateInfo['main_html']; | ||
| 297 | - $main_style = $TemplateInfo['main_css']; | ||
| 298 | - } | ||
| 299 | - $commonInfo = $this->getCommonPage($source,$source_id,$info['template_id']); | ||
| 300 | - if($commonInfo !== false){ | ||
| 301 | - $html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other']. | ||
| 302 | - $commonInfo['head_html'].$main_html.$commonInfo['footer_html']; | ||
| 303 | - }else{ | ||
| 304 | - $html = preg_replace('/<style id="globalsojs-styles">(.*?)<\/style>/s', $main_style, $homeTemplateInfo['html']); | ||
| 305 | - $html = preg_replace('/<main\b[^>]*>(.*?)<\/main>/s', $main_html, $html); | ||
| 306 | - } | ||
| 307 | - $TemplateInfo['html'] = $this->getHeadFooter($html);//组装数据 | ||
| 308 | - return $this->success($TemplateInfo); | ||
| 309 | - } | ||
| 310 | - | ||
| 311 | - /** | ||
| 312 | - * @remark :获取自定义模块的html | ||
| 313 | - * @name :customHtml | ||
| 314 | - * @author :lyh | ||
| 315 | - * @method :post | ||
| 316 | - * @time :2023/12/12 9:39 | ||
| 317 | - */ | ||
| 318 | - public function customHtml($info,$source,$source_id,$is_custom){ | ||
| 319 | - $templateInfo = $this->webTemplateInfo($info['template_id'],$source,$source_id,$is_custom); | ||
| 320 | - if($templateInfo === false){ | ||
| 321 | - //TODO::取新闻的默认页,后期如果更新,修改此处 | ||
| 322 | - $news_source = 3; | ||
| 323 | - $mainInfo = $this->getCommonMain($news_source,$source_id); | ||
| 324 | - $main_html = $mainInfo['main_html']; | ||
| 325 | - $main_style = $mainInfo['main_css']; | ||
| 326 | - $templateInfo['template_id'] = $info['template_id']; | ||
| 327 | - }else{ | ||
| 328 | - $main_html = $templateInfo['main_html']; | ||
| 329 | - $main_style = $templateInfo['main_css']; | ||
| 330 | - } | ||
| 331 | - //TODO::无独立头部时,取首页的头部和底部 | ||
| 332 | - $commonTemplateModel = new BTemplateCommon(); | ||
| 333 | - $commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]); | ||
| 334 | - $html = $commonInfo['head_css'].$main_style.$commonInfo['footer_css'].$commonInfo['other']. | ||
| 335 | - $commonInfo['head_html'].$main_html.$commonInfo['footer_html']; | ||
| 336 | - $templateInfo['html'] = $this->getHeadFooter($html);//组装数据 | ||
| 337 | - return $this->success($templateInfo); | ||
| 338 | - } | ||
| 339 | - | ||
| 340 | - /** | ||
| 341 | * @remark :获取中间公共部分 | 234 | * @remark :获取中间公共部分 |
| 342 | * @name :getCommonMain | 235 | * @name :getCommonMain |
| 343 | * @author :lyh | 236 | * @author :lyh |
-
请 注册 或 登录 后发表评论