|
...
|
...
|
@@ -90,11 +90,11 @@ class ProductLogic extends BaseLogic |
|
|
|
* @time :2023/8/21 17:11
|
|
|
|
*/
|
|
|
|
public function productDelete(){
|
|
|
|
// DB::beginTransaction();
|
|
|
|
// try {
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
foreach ($this->param['ids'] as $k => $id) {
|
|
|
|
$info = $this->model->read(['id'=>$id]);
|
|
|
|
if($info->status == Product::STATUS_RECYCLE){
|
|
|
|
if($info['status'] == Product::STATUS_RECYCLE){
|
|
|
|
//删除路由映射
|
|
|
|
RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
|
|
|
//删除当前产品模版
|
|
...
|
...
|
@@ -102,14 +102,14 @@ class ProductLogic extends BaseLogic |
|
|
|
$this->model->del(['id'=>$id]);
|
|
|
|
}else{
|
|
|
|
//回收站
|
|
|
|
$this->model->edit(['status'=>2],['id'=>$id]);
|
|
|
|
$this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// DB::commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('删除失败');
|
|
|
|
// }
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('删除失败');
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|