dyjh пре 6 година
родитељ
комит
28c0b38154
1 измењених фајлова са 13 додато и 0 уклоњено
  1. 13 0
      app/Http/Controllers/Admin/Album/AgentController.php

+ 13 - 0
app/Http/Controllers/Admin/Album/AgentController.php

xqd
@@ -121,6 +121,19 @@ class AgentController extends Controller
         return view('admin.album.agent.edit',compact('data','video'));
     }
 
+    public function videoDel(Request $request)
+    {
+        $check = AgentBannerModel::find($request->get('id'));
+        if($check) $osskey = $check->oss_key;
+        if(!$check) return  $this->showWarning("操作失败");
+        $bool = AgentBannerModel::where('id',$request->get('id'))->delete();
+        if($bool) {
+            OSS::publicDeleteObject(config('alioss.BucketName'),$osskey);
+            return  $this->showMessage('操作成功');
+        }else{
+            return  $this->showWarning("操作失败");
+        }
+    }
     /**
      * 保存修改
      */