add default titlepic

This commit is contained in:
LI JIAHAO
2017-06-14 16:13:00 +08:00
parent 59e27611d5
commit 0255e79ae7
+4 -1
View File
@@ -345,7 +345,10 @@ class GoodController extends Controller
$width = 1920;
if($height > 1080)
$height = 1080;
$file = Storage::get('good/titlepic/'.$good_id);
if (!Storage::exists('good/titlepic/'.$good_id))
$file = Storage::get('public/titlepic.jpg');
else
$file = Storage::get('good/titlepic/'.$good_id);
$image = Image::make($file)->resize($width, $height);
return $image->response('jpg');
}