作者 lyh

gx

... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Bside\BTemplate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BCustomTemplate;
class CustomTemplateLogic extends BaseLogic
... ... @@ -37,6 +38,7 @@ class CustomTemplateLogic extends BaseLogic
*/
public function customTemplateInfo(){
$info = $this->model->read(['id'=>$this->param['id']]);
$info['html'] = $this->getHeadFooter();
if($info === false){
$this->fail('error');
}
... ... @@ -77,4 +79,27 @@ class CustomTemplateLogic extends BaseLogic
}
return $this->success();
}
/**
* @remark :拼接获取公共头部底部
* @name :getHeadFooter
* @author :lyh
* @method :post
* @time :2023/7/21 17:22
*/
public function getHeadFooter($html = ''){
//获取公共主题头部底部
$serviceSettingModel = new ServiceSettingModel();
$list = $serviceSettingModel->list(['type'=>2],'created_at');
//拼接html
foreach ($list as $v){
if($v['key'] == 'head'){
$html = $v['values'].$html;
}
if($v['key'] == 'footer'){
$html = $html.$v['values'];
}
}
return $html;
}
}
... ...