|
@@ -54,8 +54,8 @@ class BlogLogic extends BaseLogic |
|
@@ -54,8 +54,8 @@ class BlogLogic extends BaseLogic |
|
54
|
*/
|
54
|
*/
|
|
55
|
public function blogSave(){
|
55
|
public function blogSave(){
|
|
56
|
//拼接参数
|
56
|
//拼接参数
|
|
57
|
-// DB::beginTransaction();
|
|
|
|
58
|
-// try {
|
57
|
+ DB::beginTransaction();
|
|
|
|
58
|
+ try {
|
|
59
|
$category = $this->param['category_id'];
|
59
|
$category = $this->param['category_id'];
|
|
60
|
$this->param = $this->paramProcessing($this->param);
|
60
|
$this->param = $this->paramProcessing($this->param);
|
|
61
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
61
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
@@ -70,11 +70,11 @@ class BlogLogic extends BaseLogic |
|
@@ -70,11 +70,11 @@ class BlogLogic extends BaseLogic |
|
70
|
if(!empty($category)){
|
70
|
if(!empty($category)){
|
|
71
|
$this->saveAssociationCate($id,$category);
|
71
|
$this->saveAssociationCate($id,$category);
|
|
72
|
}
|
72
|
}
|
|
73
|
-// DB::commit();
|
|
|
|
74
|
-// }catch (\Exception $e){
|
|
|
|
75
|
-// DB::rollBack();
|
|
|
|
76
|
-// $this->fail('error');
|
|
|
|
77
|
-// }
|
73
|
+ DB::commit();
|
|
|
|
74
|
+ }catch (\Exception $e){
|
|
|
|
75
|
+ DB::rollBack();
|
|
|
|
76
|
+ $this->fail('error');
|
|
|
|
77
|
+ }
|
|
78
|
//通知更新
|
78
|
//通知更新
|
|
79
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]);
|
79
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]);
|
|
80
|
return $this->success();
|
80
|
return $this->success();
|