作者 lyh

gx

... ... @@ -259,8 +259,8 @@ class BTemplateLogic extends BaseLogic
$this->fail('演示项目仅支持演示功能,无法更改首页');
}
//查询当前模版是否已保存
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
//字符串截取
$this->param = $this->stringProcessing($this->param);
... ... @@ -274,11 +274,11 @@ class BTemplateLogic extends BaseLogic
}
//写入操作模版记录
$this->setTemplateLog($this->param);
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
}
//通知更新
$this->homeOrProduct($this->param['source'],$this->param['source_id']);
return $this->success();
... ... @@ -596,6 +596,7 @@ class BTemplateLogic extends BaseLogic
'main_html'=>characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s'),
'main_css'=>characterTruncation($this->param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s'),
];
$data['section_list_id'] = $this->param['section_list_id'];
//保存中间部分
$bTemplateMainModel = new BTemplateMain();
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
... ...