|
...
|
...
|
@@ -174,8 +174,8 @@ class BTemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function templateSave(){
|
|
|
|
//查询当前模版是否已保存
|
|
|
|
// 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);
|
|
...
|
...
|
@@ -186,11 +186,11 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
$this->setTemplateLog($this->param);
|
|
|
|
// DB::commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('error');
|
|
|
|
// }
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
//通知更新
|
|
|
|
$this->homeOrProduct($this->param['source'],$this->param['source_id']);
|
|
|
|
return $this->success();
|
|
...
|
...
|
@@ -209,6 +209,14 @@ class BTemplateLogic extends BaseLogic |
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'operator_id'=>$this->user['id'],
|
|
|
|
'text'=>$param['html'],
|
|
|
|
'source'=>$param['source'],
|
|
|
|
'source_id'=>$param['source_id'],
|
|
|
|
'head_html'=>$param['head_html'],
|
|
|
|
'head_css'=>$param['head_css'],
|
|
|
|
'main_html'=>$param['main_html'],
|
|
|
|
'main_css'=>$param['main_css'],
|
|
|
|
'footer_html'=>$param['footer_html'],
|
|
|
|
'footer_css'=>$param['footer_css'],
|
|
|
|
];
|
|
|
|
$bTemplateLogModel = new BTemplateLog();
|
|
|
|
return $bTemplateLogModel->add($data);
|
...
|
...
|
|