|
...
|
...
|
@@ -198,13 +198,13 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
|
|
|
//字符串截取
|
|
|
|
$this->param = $this->stringProcessing($this->param);
|
|
|
|
$this->saveCommonTemplate($this->param);
|
|
|
|
$this->param = $this->templateSaveParam($this->param);//组装数据
|
|
|
|
if($info === false){
|
|
|
|
$this->model->add($this->param);
|
|
|
|
}else{
|
|
|
|
$this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
$this->saveCommonTemplate($this->param);
|
|
|
|
$this->setTemplateLog($this->param);
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
...
|
...
|
@@ -300,6 +300,11 @@ class BTemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function templateSaveParam($param){
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
if($param['source'] == 1){//首页
|
|
|
|
$param['html'] = characterTruncation($param['html'],'/<style id="globalsojs-header">(.*?)<\/footer>/s');
|
|
|
|
}else{
|
|
|
|
$param['html'] = $param['main_html'];
|
|
|
|
}
|
|
|
|
return $this->success($param);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|