Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
1 个修改的文件
包含
28 行增加
和
0 行删除
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Bside\BTemplate; | 3 | namespace App\Http\Logic\Bside\BTemplate; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Bside\BaseLogic; | 5 | use App\Http\Logic\Bside\BaseLogic; |
| 6 | +use App\Models\Service\Service as ServiceSettingModel; | ||
| 6 | use App\Models\Template\BCustomTemplate; | 7 | use App\Models\Template\BCustomTemplate; |
| 7 | 8 | ||
| 8 | class CustomTemplateLogic extends BaseLogic | 9 | class CustomTemplateLogic extends BaseLogic |
| @@ -37,6 +38,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -37,6 +38,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 37 | */ | 38 | */ |
| 38 | public function customTemplateInfo(){ | 39 | public function customTemplateInfo(){ |
| 39 | $info = $this->model->read(['id'=>$this->param['id']]); | 40 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 41 | + $info['html'] = $this->getHeadFooter(); | ||
| 40 | if($info === false){ | 42 | if($info === false){ |
| 41 | $this->fail('error'); | 43 | $this->fail('error'); |
| 42 | } | 44 | } |
| @@ -52,6 +54,9 @@ class CustomTemplateLogic extends BaseLogic | @@ -52,6 +54,9 @@ class CustomTemplateLogic extends BaseLogic | ||
| 52 | */ | 54 | */ |
| 53 | public function customTemplateSave(){ | 55 | public function customTemplateSave(){ |
| 54 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 56 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 57 | + if(isset($this->param['html']) && !empty($this->param['html'])){ | ||
| 58 | + $this->param['html'] = $this->getHeadFooter(characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/footer>/s')); | ||
| 59 | + } | ||
| 55 | $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | 60 | $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 56 | }else{ | 61 | }else{ |
| 57 | $this->param['project_id'] = $this->user['project_id']; | 62 | $this->param['project_id'] = $this->user['project_id']; |
| @@ -77,4 +82,27 @@ class CustomTemplateLogic extends BaseLogic | @@ -77,4 +82,27 @@ class CustomTemplateLogic extends BaseLogic | ||
| 77 | } | 82 | } |
| 78 | return $this->success(); | 83 | return $this->success(); |
| 79 | } | 84 | } |
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * @remark :拼接获取公共头部底部 | ||
| 88 | + * @name :getHeadFooter | ||
| 89 | + * @author :lyh | ||
| 90 | + * @method :post | ||
| 91 | + * @time :2023/7/21 17:22 | ||
| 92 | + */ | ||
| 93 | + public function getHeadFooter($html = ''){ | ||
| 94 | + //获取公共主题头部底部 | ||
| 95 | + $serviceSettingModel = new ServiceSettingModel(); | ||
| 96 | + $list = $serviceSettingModel->list(['type'=>2],'created_at'); | ||
| 97 | + //拼接html | ||
| 98 | + foreach ($list as $v){ | ||
| 99 | + if($v['key'] == 'head'){ | ||
| 100 | + $html = $v['values'].$html; | ||
| 101 | + } | ||
| 102 | + if($v['key'] == 'footer'){ | ||
| 103 | + $html = $html.$v['values']; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + return $html; | ||
| 107 | + } | ||
| 80 | } | 108 | } |
-
请 注册 或 登录 后发表评论