From 80361c8f5c800f23406b8d9779e28cd643547460 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Tue, 5 Sep 2017 21:43:58 +0100 Subject: [PATCH] #16: Ignore photos that have an empty camera make/model --- app/Album.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Album.php b/app/Album.php index 929dd8a..5c1f08f 100644 --- a/app/Album.php +++ b/app/Album.php @@ -60,7 +60,11 @@ class Album extends Model public function cameras() { return DB::table('photos') - ->where('album_id', $this->id) + ->where([ + ['album_id', $this->id], + ['camera_make', '!=', ''], + ['camera_model', '!=', ''] + ]) ->groupBy('camera_make', 'camera_model', 'camera_software') ->select('camera_make', 'camera_model', 'camera_software', DB::raw('count(*) as photo_count')) ->orderBy('photo_count', 'desc')