|
@@ -66,8 +66,8 @@ class CategoryLogic extends BaseLogic |
|
@@ -66,8 +66,8 @@ class CategoryLogic extends BaseLogic |
|
66
|
* @time :2023/8/21 17:14
|
66
|
* @time :2023/8/21 17:14
|
|
67
|
*/
|
67
|
*/
|
|
68
|
public function categorySave(){
|
68
|
public function categorySave(){
|
|
69
|
-// DB::beginTransaction();
|
|
|
|
70
|
-// try {
|
69
|
+ DB::beginTransaction();
|
|
|
|
70
|
+ try {
|
|
71
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
71
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
72
|
$this->handleEditParam($this->param);
|
72
|
$this->handleEditParam($this->param);
|
|
73
|
$id = $this->param['id'];
|
73
|
$id = $this->param['id'];
|
|
@@ -78,11 +78,11 @@ class CategoryLogic extends BaseLogic |
|
@@ -78,11 +78,11 @@ class CategoryLogic extends BaseLogic |
|
78
|
}
|
78
|
}
|
|
79
|
//路由映射
|
79
|
//路由映射
|
|
80
|
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']);
|
80
|
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']);
|
|
81
|
-// DB::commit();
|
|
|
|
82
|
-// } catch (\Exception $e){
|
|
|
|
83
|
-// DB::rollBack();
|
|
|
|
84
|
-// $this->fail('保存失败');
|
|
|
|
85
|
-// }
|
81
|
+ DB::commit();
|
|
|
|
82
|
+ } catch (\Exception $e){
|
|
|
|
83
|
+ DB::rollBack();
|
|
|
|
84
|
+ $this->fail('保存失败');
|
|
|
|
85
|
+ }
|
|
86
|
//通知更新
|
86
|
//通知更新
|
|
87
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_CATE, 'route'=>$route]);
|
87
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_CATE, 'route'=>$route]);
|
|
88
|
return $this->success();
|
88
|
return $this->success();
|