正在显示
1 个修改的文件
包含
9 行增加
和
9 行删除
| @@ -424,14 +424,16 @@ class ProductLogic extends BaseLogic | @@ -424,14 +424,16 @@ class ProductLogic extends BaseLogic | ||
| 424 | * @time :2023/8/21 17:11 | 424 | * @time :2023/8/21 17:11 |
| 425 | */ | 425 | */ |
| 426 | public function productDelete(){ | 426 | public function productDelete(){ |
| 427 | - DB::connection('custom_mysql')->beginTransaction(); | ||
| 428 | - try { | 427 | +// DB::connection('custom_mysql')->beginTransaction(); |
| 428 | +// try { | ||
| 429 | $cateRelate = new CategoryRelated(); | 429 | $cateRelate = new CategoryRelated(); |
| 430 | //删除扩展字段 | 430 | //删除扩展字段 |
| 431 | $extendInfoModel = new ExtendInfo(); | 431 | $extendInfoModel = new ExtendInfo(); |
| 432 | foreach ($this->param['ids'] as $id) { | 432 | foreach ($this->param['ids'] as $id) { |
| 433 | $info = $this->model->read(['id'=>$id],['id','status']); | 433 | $info = $this->model->read(['id'=>$id],['id','status']); |
| 434 | if($info['status'] == Product::STATUS_RECYCLE){ | 434 | if($info['status'] == Product::STATUS_RECYCLE){ |
| 435 | + //删除路由映射 | ||
| 436 | + RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); | ||
| 435 | //删除当前产品模版 | 437 | //删除当前产品模版 |
| 436 | // $this->delProductModule($id); | 438 | // $this->delProductModule($id); |
| 437 | $this->model->del(['id'=>$id]); | 439 | $this->model->del(['id'=>$id]); |
| @@ -439,18 +441,16 @@ class ProductLogic extends BaseLogic | @@ -439,18 +441,16 @@ class ProductLogic extends BaseLogic | ||
| 439 | $cateRelate->del(['product_id'=>$id]); | 441 | $cateRelate->del(['product_id'=>$id]); |
| 440 | $extendInfoModel->del(['product_id'=>$id]); | 442 | $extendInfoModel->del(['product_id'=>$id]); |
| 441 | }else{ | 443 | }else{ |
| 442 | - //删除路由映射 | ||
| 443 | - RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); | ||
| 444 | //回收站 | 444 | //回收站 |
| 445 | $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]); | 445 | $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]); |
| 446 | } | 446 | } |
| 447 | $this->delRoute($id); | 447 | $this->delRoute($id); |
| 448 | } | 448 | } |
| 449 | - DB::connection('custom_mysql')->commit(); | ||
| 450 | - }catch (\Exception $e){ | ||
| 451 | - DB::connection('custom_mysql')->rollBack(); | ||
| 452 | - $this->fail('删除失败'); | ||
| 453 | - } | 449 | +// DB::connection('custom_mysql')->commit(); |
| 450 | +// }catch (\Exception $e){ | ||
| 451 | +// DB::connection('custom_mysql')->rollBack(); | ||
| 452 | +// $this->fail('删除失败'); | ||
| 453 | +// } | ||
| 454 | return $this->success(); | 454 | return $this->success(); |
| 455 | } | 455 | } |
| 456 | 456 |
-
请 注册 或 登录 后发表评论