Bugfix Order

This commit is contained in:
2015-11-11 02:49:59 +01:00
parent e5cfb4b5a9
commit 161eabdf00
7 changed files with 231 additions and 247 deletions

View File

@@ -28,12 +28,13 @@ class Film extends Eloquent {
return $query
->addSelect(DB::raw('film_films.*, COUNT(case when film_votes.stimme IS TRUE then 1 end) as upvotes'))
->leftJoin('votes', 'votes.film', '=', 'films.id')
->leftJoin('users', 'users.id', '=', 'votes.user')
->whereNull('gesehen')
->where('films.id', "!=", is_object($nextfilm) ? $nextfilm->id : 0)
->where('users.settings', 'NOT LIKE', '%disabled":true%')
->groupBy('films.id')
->orderBy('upvotes', 'DESC')
->orderBy('vorgeschlagen', 'ASC')
->take(5);
->orderBy('vorgeschlagen', 'ASC');
}
public function getVotes() {