|
@@ -424,8 +424,8 @@ class ProductLogic extends BaseLogic |
|
@@ -424,8 +424,8 @@ 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();
|
|
@@ -434,6 +434,7 @@ class ProductLogic extends BaseLogic |
|
@@ -434,6 +434,7 @@ class ProductLogic extends BaseLogic |
|
434
|
if($info['status'] == Product::STATUS_RECYCLE){
|
434
|
if($info['status'] == Product::STATUS_RECYCLE){
|
|
435
|
//删除路由映射
|
435
|
//删除路由映射
|
|
436
|
RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
436
|
RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
|
|
|
437
|
+ $this->delRoute($id);
|
|
437
|
//删除当前产品模版
|
438
|
//删除当前产品模版
|
|
438
|
// $this->delProductModule($id);
|
439
|
// $this->delProductModule($id);
|
|
439
|
$this->model->del(['id'=>$id]);
|
440
|
$this->model->del(['id'=>$id]);
|
|
@@ -441,16 +442,16 @@ class ProductLogic extends BaseLogic |
|
@@ -441,16 +442,16 @@ class ProductLogic extends BaseLogic |
|
441
|
$cateRelate->del(['product_id'=>$id]);
|
442
|
$cateRelate->del(['product_id'=>$id]);
|
|
442
|
$extendInfoModel->del(['product_id'=>$id]);
|
443
|
$extendInfoModel->del(['product_id'=>$id]);
|
|
443
|
}else{
|
444
|
}else{
|
|
|
|
445
|
+ $this->delRoute($id);
|
|
444
|
//回收站
|
446
|
//回收站
|
|
445
|
$this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]);
|
447
|
$this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]);
|
|
446
|
}
|
448
|
}
|
|
447
|
- $this->delRoute($id);
|
|
|
|
448
|
}
|
449
|
}
|
|
449
|
-// DB::connection('custom_mysql')->commit();
|
|
|
|
450
|
-// }catch (\Exception $e){
|
|
|
|
451
|
-// DB::connection('custom_mysql')->rollBack();
|
|
|
|
452
|
-// $this->fail('删除失败');
|
|
|
|
453
|
-// }
|
450
|
+ DB::connection('custom_mysql')->commit();
|
|
|
|
451
|
+ }catch (\Exception $e){
|
|
|
|
452
|
+ DB::connection('custom_mysql')->rollBack();
|
|
|
|
453
|
+ $this->fail('删除失败');
|
|
|
|
454
|
+ }
|
|
454
|
return $this->success();
|
455
|
return $this->success();
|
|
455
|
}
|
456
|
}
|
|
456
|
|
457
|
|