|
| xqd
@@ -174,6 +174,23 @@ class PosterController extends Controller
|
|
|
$img = '/base/img/poster.jpg';
|
|
|
return view('admin.album.poster.view', compact('img'));
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ public function destroy(Request $request)
|
|
|
+ {
|
|
|
+ //$bool = $this->repository->destroy($request->get('id'));
|
|
|
+ $cat = AlbumPosterModel::find($request->get('id'));
|
|
|
+ $res = json_decode($cat->video_url, true);
|
|
|
+ if ($res != '') {
|
|
|
+ OSS::publicDeleteObject(config('alioss.BucketName'), $res['oss_key']);
|
|
|
+ }
|
|
|
+ $ok = $cat->delete();
|
|
|
+ if ($ok) {
|
|
|
+ return $this->showMessage('操作成功');
|
|
|
+ } else {
|
|
|
+ return $this->showWarning("操作失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|