|
...
|
...
|
@@ -424,8 +424,8 @@ class ProductLogic extends BaseLogic |
|
|
|
* @time :2023/8/21 17:11
|
|
|
|
*/
|
|
|
|
public function productDelete(){
|
|
|
|
// DB::connection('custom_mysql')->beginTransaction();
|
|
|
|
// try {
|
|
|
|
DB::connection('custom_mysql')->beginTransaction();
|
|
|
|
try {
|
|
|
|
$cateRelate = new CategoryRelated();
|
|
|
|
//删除扩展字段
|
|
|
|
$extendInfoModel = new ExtendInfo();
|
|
...
|
...
|
@@ -434,6 +434,7 @@ class ProductLogic extends BaseLogic |
|
|
|
if($info['status'] == Product::STATUS_RECYCLE){
|
|
|
|
//删除路由映射
|
|
|
|
RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
|
|
|
$this->delRoute($id);
|
|
|
|
//删除当前产品模版
|
|
|
|
// $this->delProductModule($id);
|
|
|
|
$this->model->del(['id'=>$id]);
|
|
...
|
...
|
@@ -441,16 +442,16 @@ class ProductLogic extends BaseLogic |
|
|
|
$cateRelate->del(['product_id'=>$id]);
|
|
|
|
$extendInfoModel->del(['product_id'=>$id]);
|
|
|
|
}else{
|
|
|
|
$this->delRoute($id);
|
|
|
|
//回收站
|
|
|
|
$this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]);
|
|
|
|
}
|
|
|
|
$this->delRoute($id);
|
|
|
|
}
|
|
|
|
// DB::connection('custom_mysql')->commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::connection('custom_mysql')->rollBack();
|
|
|
|
// $this->fail('删除失败');
|
|
|
|
// }
|
|
|
|
DB::connection('custom_mysql')->commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::connection('custom_mysql')->rollBack();
|
|
|
|
$this->fail('删除失败');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|