|
|
@ -38,7 +38,7 @@ class VideoService extends AdminBaseService |
|
|
|
public function addVideoOnDemand($param) |
|
|
|
{ |
|
|
|
try { |
|
|
|
if (empty($param['title']) || empty($param['cover_url']) || empty($param['state']) || empty($param['video_collection'])) { |
|
|
|
if (empty($param['title']) || empty($param['cover_url']) || empty($param['state']) || empty($param['video_collection']) || empty($param['video_type'])) { |
|
|
|
return $this->toData('400', '参错错误'); |
|
|
|
} |
|
|
|
$insert = VideoOnDemandModel::create([ |
|
|
@ -48,7 +48,9 @@ class VideoService extends AdminBaseService |
|
|
|
'banner_url' => $param['banner_url'], |
|
|
|
'sort' => $param['sort'] ?? 0, |
|
|
|
'state' => $param['state'], |
|
|
|
'video_collection' => $param['video_collection'] |
|
|
|
'video_collection' => $param['video_collection'], |
|
|
|
'video_type' => $param['video_type'], |
|
|
|
'sub_type' => $param['sub_type'] ?? 0, |
|
|
|
]); |
|
|
|
return $this->toData('0', 'SUCCESS', ['insert_id' => $insert->id]); |
|
|
|
} catch (\Exception $exception) { |
|
|
@ -63,7 +65,7 @@ class VideoService extends AdminBaseService |
|
|
|
if (empty($param['id'])) { |
|
|
|
return $this->toData('400', 'Missing param id'); |
|
|
|
} |
|
|
|
if (empty($param['title']) || empty($param['cover_url']) || empty($param['state']) || empty($param['video_collection'])) { |
|
|
|
if (empty($param['title']) || empty($param['cover_url']) || empty($param['state']) || empty($param['video_collection']) || empty($param['video_type'])) { |
|
|
|
return $this->toData('400', '参错错误'); |
|
|
|
} |
|
|
|
$ckInfo = VideoOnDemandModel::where('id', $param['id'])->find(); |
|
|
@ -78,6 +80,8 @@ class VideoService extends AdminBaseService |
|
|
|
$ckInfo->sort = $param['sort']; |
|
|
|
$ckInfo->state = $param['state']; |
|
|
|
$ckInfo->video_collection = $param['video_collection']; |
|
|
|
$ckInfo->video_type = $param['video_type']; |
|
|
|
$ckInfo->sub_type = $param['sub_type']; |
|
|
|
$ckInfo->save(); |
|
|
|
return $this->toData('0', 'success'); |
|
|
|
} catch (\Exception $exception) { |
|
|
|