正在显示
1 个修改的文件
包含
25 行增加
和
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 | } |
| @@ -77,4 +79,27 @@ class CustomTemplateLogic extends BaseLogic | @@ -77,4 +79,27 @@ class CustomTemplateLogic extends BaseLogic | ||
| 77 | } | 79 | } |
| 78 | return $this->success(); | 80 | return $this->success(); |
| 79 | } | 81 | } |
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * @remark :拼接获取公共头部底部 | ||
| 85 | + * @name :getHeadFooter | ||
| 86 | + * @author :lyh | ||
| 87 | + * @method :post | ||
| 88 | + * @time :2023/7/21 17:22 | ||
| 89 | + */ | ||
| 90 | + public function getHeadFooter($html = ''){ | ||
| 91 | + //获取公共主题头部底部 | ||
| 92 | + $serviceSettingModel = new ServiceSettingModel(); | ||
| 93 | + $list = $serviceSettingModel->list(['type'=>2],'created_at'); | ||
| 94 | + //拼接html | ||
| 95 | + foreach ($list as $v){ | ||
| 96 | + if($v['key'] == 'head'){ | ||
| 97 | + $html = $v['values'].$html; | ||
| 98 | + } | ||
| 99 | + if($v['key'] == 'footer'){ | ||
| 100 | + $html = $html.$v['values']; | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + return $html; | ||
| 104 | + } | ||
| 80 | } | 105 | } |
-
请 注册 或 登录 后发表评论