Commit 1e9dff72 by 杨昕

排除media_url为null字符串的

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