Commit 3d5ab378 by 杨昕

替换播放链接

parent f6a558cf
Pipeline #11373 passed with stages
in 47 seconds
......@@ -127,7 +127,6 @@ class MediaController extends Controller
'secret_key' => '',
'media_url' => 'required',
'description' => '',
'replace' => ''
// 'start_time' => 'required|date',
// 'end_time' => 'required|date|after_or_equal:start_time',
]);
......
......@@ -177,10 +177,18 @@ class MediaModel extends Eloquent
$media_id = $request->media_id;
$media = MediaModel::where("_id",$media_id)->first();
if ($request->replace){
$recycleId = RecycleModel::addRecycle($media_id);
if (!$recycleId){
throw new \Exception('回收站保存失败');
}
}else{
$media = MediaModel::where("_id",$media_id)->first();
if (!empty($media)){
throw new \Exception("媒资编号已被使用");
if (!empty($media)){
throw new \Exception("媒资编号已被使用");
}
}
//hb15011&河北公务员考试试题
......@@ -304,15 +312,6 @@ class MediaModel extends Eloquent
throw new \Exception("媒资类别不存在");
}
if ($request->replace){
$recycleId = RecycleModel::addRecycle($id);
if (!$recycleId){
throw new \Exception('回收站保存失败');
}
}
/**
* 处理文件名称,确认是否包含"&"符合
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment