refactor: 去除视频信息删除时验证
This commit is contained in:
@@ -240,12 +240,6 @@ class Video
|
|||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$id = request()->param('id');
|
$id = request()->param('id');
|
||||||
|
|
||||||
$validate = new VideoValidate;
|
|
||||||
if (!$validate->scene('delete')->check(['id' => $id])) {
|
|
||||||
return error($validate->getError());
|
|
||||||
}
|
|
||||||
|
|
||||||
$video = VideoModel::bypk($id)->find();
|
$video = VideoModel::bypk($id)->find();
|
||||||
if (empty($video)) {
|
if (empty($video)) {
|
||||||
return error('请确认操作对象是不存在');
|
return error('请确认操作对象是不存在');
|
||||||
|
|||||||
@@ -83,12 +83,4 @@ class VideoValidate extends Validate
|
|||||||
{
|
{
|
||||||
return $this->only(['sort']);
|
return $this->only(['sort']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除韬晦
|
|
||||||
*/
|
|
||||||
public function sceneDelete()
|
|
||||||
{
|
|
||||||
return $this->only(['id']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user