|
...
|
...
|
@@ -105,17 +105,15 @@ class BTemplateLogic extends BaseLogic |
|
|
|
'template_id'=>$this->param['template_id'],
|
|
|
|
]
|
|
|
|
);
|
|
|
|
//字符串截取
|
|
|
|
$this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s');
|
|
|
|
$this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
$this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s');
|
|
|
|
$this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s');
|
|
|
|
$this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/s');
|
|
|
|
$this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s');
|
|
|
|
if($info === false){
|
|
|
|
//字符串截取
|
|
|
|
$this->StringProcessing();
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
var_dump($this->param);
|
|
|
|
die();
|
|
|
|
$rs = $this->model->add($this->param);
|
|
|
|
}else{
|
|
|
|
$this->StringProcessing();
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
if($rs === false){
|
|
...
|
...
|
@@ -123,4 +121,21 @@ class BTemplateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :字符串处理
|
|
|
|
* @name :StringProcessing
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/29 15:35
|
|
|
|
*/
|
|
|
|
public function StringProcessing(){
|
|
|
|
//字符串截取
|
|
|
|
$this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s');
|
|
|
|
$this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
$this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s');
|
|
|
|
$this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s');
|
|
|
|
$this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/s');
|
|
|
|
$this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|