#16: Ignore photos that have an empty camera make/model

This commit is contained in:
Andy Heathershaw 2017-09-05 21:43:58 +01:00
parent 280768d001
commit 80361c8f5c

View File

@ -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')