Commit 1e9dff72 by 杨昕

排除media_url为null字符串的

parent 65e50a5f
......@@ -274,8 +274,9 @@ class MediaModel extends Eloquent
$id = MediaModel::insertGetId($data);
//处理封面图片以及分辨率
self::getScreeShotInfo($media_id);
if ($request->media_url != "null"){
self::getScreeShotInfo($media_id);
}
LogModel::addlog(["添加媒资信息" => $data, ['媒资ID为:=> ' . $id]]);
} catch (\Exception $exception) {
throw new DatabaseException($exception->getMessage());
......@@ -365,7 +366,9 @@ class MediaModel extends Eloquent
throw new \Exception("更新失败");
}
//处理封面图片以及分辨率
self::getScreeShotInfo($id);
if ($request->media_url != "null"){
self::getScreeShotInfo($id);
}
LogModel::addlog(["更新媒资信息=>" . $id, $data]);
} catch (\Exception $exception) {
......@@ -1152,7 +1155,8 @@ class MediaModel extends Eloquent
$match = [
'status' => "1",
"screen_shot" => null,
"media_audio" => ["\$ne" => 'audio']
"media_audio" => ["\$ne" => 'audio'],
"media_url" => ["\$ne" => "null"],
];
if (isset($request->media_id) && !empty($request->media_id)) {
......@@ -1170,6 +1174,7 @@ class MediaModel extends Eloquent
}
$media = MediaModel::where($match)->first();
//处理封面图片以及分辨率
self::getScreeShotInfo($media["_id"]);
} catch (\Exception $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