|
@@ -26,7 +26,7 @@ class Film extends Eloquent {
|
|
|
public function scopeMeistgewunschteVorschlage($query) {
|
|
|
$nextfilm = Dumbo::find(1)->film;
|
|
|
return $query
|
|
|
- ->addSelect(DB::raw('film_films.*, COUNT(case when film_votes.stimme IS TRUE then 1 end) as upvotes'))
|
|
|
+ ->addSelect(DB::raw('film_films.*, COUNT(case when film_votes.stimme IS TRUE then 1 end) as upvotes, COUNT(*) as votes'))
|
|
|
->leftJoin('votes', 'votes.film', '=', 'films.id')
|
|
|
->leftJoin('users', 'users.id', '=', 'votes.user')
|
|
|
->whereNull('gesehen')
|
|
@@ -60,4 +60,4 @@ class Film extends Eloquent {
|
|
|
return $tmdb->getImageUrl($tmovie['poster_path'], TMDb::IMAGE_POSTER, 'w342');
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|