正在显示
1 个修改的文件
包含
25 行增加
和
1 行删除
| @@ -5,6 +5,8 @@ namespace App\Http\Logic\Bside\BTemplate; | @@ -5,6 +5,8 @@ namespace App\Http\Logic\Bside\BTemplate; | ||
| 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\Service\Service as ServiceSettingModel; |
| 7 | use App\Models\Template\BCustomTemplate; | 7 | use App\Models\Template\BCustomTemplate; |
| 8 | +use App\Models\Template\BSetting; | ||
| 9 | +use App\Models\Template\Template; | ||
| 8 | 10 | ||
| 9 | class CustomTemplateLogic extends BaseLogic | 11 | class CustomTemplateLogic extends BaseLogic |
| 10 | { | 12 | { |
| @@ -38,7 +40,10 @@ class CustomTemplateLogic extends BaseLogic | @@ -38,7 +40,10 @@ class CustomTemplateLogic extends BaseLogic | ||
| 38 | */ | 40 | */ |
| 39 | public function customTemplateInfo(){ | 41 | public function customTemplateInfo(){ |
| 40 | $info = $this->model->read(['id'=>$this->param['id']]); | 42 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 41 | - $info['html'] = $this->getHeadFooter(); | 43 | + if(!empty($info['html'])){ |
| 44 | + $html = $this->getBodyHeaderFooter(); | ||
| 45 | + $info['html'] = $this->getHeadFooter($html); | ||
| 46 | + } | ||
| 42 | if($info === false){ | 47 | if($info === false){ |
| 43 | $this->fail('error'); | 48 | $this->fail('error'); |
| 44 | } | 49 | } |
| @@ -84,6 +89,25 @@ class CustomTemplateLogic extends BaseLogic | @@ -84,6 +89,25 @@ class CustomTemplateLogic extends BaseLogic | ||
| 84 | } | 89 | } |
| 85 | 90 | ||
| 86 | /** | 91 | /** |
| 92 | + * @remark :获取body的详情 | ||
| 93 | + * @name :getBodyHeaderFooter | ||
| 94 | + * @author :lyh | ||
| 95 | + * @method :post | ||
| 96 | + * @time :2023/7/21 18:08 | ||
| 97 | + */ | ||
| 98 | + public function getBodyHeaderFooter(){ | ||
| 99 | + $html = ''; | ||
| 100 | + //获取设置的默认模版 | ||
| 101 | + $bSettingModel = new BSetting(); | ||
| 102 | + $info = $bSettingModel->read(['project_id'=>$this->user['project_id']]); | ||
| 103 | + //获取模板详情 | ||
| 104 | + $ATemplateModel = new Template(); | ||
| 105 | + $TemplateInfo = $ATemplateModel->read(['id'=>$info['template_id']]); | ||
| 106 | + $html = $html.$TemplateInfo['head_css'].$TemplateInfo['footer_css'].$TemplateInfo['head_html'].$TemplateInfo['footer_html']; | ||
| 107 | + return $html; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + /** | ||
| 87 | * @remark :拼接获取公共头部底部 | 111 | * @remark :拼接获取公共头部底部 |
| 88 | * @name :getHeadFooter | 112 | * @name :getHeadFooter |
| 89 | * @author :lyh | 113 | * @author :lyh |
-
请 注册 或 登录 后发表评论