作者 lyh

gx

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