|
@@ -110,19 +110,19 @@ class CustomTemplateLogic extends BaseLogic |
|
@@ -110,19 +110,19 @@ class CustomTemplateLogic extends BaseLogic |
|
110
|
* @method :post
|
110
|
* @method :post
|
|
111
|
* @time :2023/10/13 14:27
|
111
|
* @time :2023/10/13 14:27
|
|
112
|
*/
|
112
|
*/
|
|
113
|
- public function saveCommonTemplate($param){
|
113
|
+ public function saveCommonTemplate($html){
|
|
114
|
$type = $this->getType();
|
114
|
$type = $this->getType();
|
|
115
|
- $templateCommonModel = new BTemplateCommon();
|
|
|
|
116
|
//获取设置的默认模版
|
115
|
//获取设置的默认模版
|
|
117
|
$bSettingModel = new Setting();
|
116
|
$bSettingModel = new Setting();
|
|
118
|
$bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
|
117
|
$bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
118
|
+ $templateCommonModel = new BTemplateCommon();
|
|
119
|
$info = $templateCommonModel->read(['template_id'=>$bSettingInfo['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
|
119
|
$info = $templateCommonModel->read(['template_id'=>$bSettingInfo['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
|
|
120
|
$data = [
|
120
|
$data = [
|
|
121
|
- 'head_html'=>characterTruncation($param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'),
|
|
|
|
122
|
- 'head_css'=>characterTruncation($param['html'],'/<style id="globalsojs-header">(.*?)<\/style>/s'),
|
|
|
|
123
|
- 'footer_html'=>characterTruncation($param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'),
|
|
|
|
124
|
- 'footer_css'=>characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
|
|
|
|
125
|
- 'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
|
121
|
+ 'head_html'=>characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s'),
|
|
|
|
122
|
+ 'head_css'=>characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s'),
|
|
|
|
123
|
+ 'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'),
|
|
|
|
124
|
+ 'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
|
|
|
|
125
|
+ 'other'=>str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")),
|
|
126
|
];
|
126
|
];
|
|
127
|
if($info === false){
|
127
|
if($info === false){
|
|
128
|
$data['template_id'] = $bSettingInfo['template_id'];
|
128
|
$data['template_id'] = $bSettingInfo['template_id'];
|