Bugfix Order
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -61,7 +61,7 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
|
||||
|
||||
public function getSetting($key, $false = false) {
|
||||
$settings = json_decode($this->settings);
|
||||
if(!is_null($settings))
|
||||
if(!is_null($settings) && property_exists($settings, $key))
|
||||
return $settings->$key;
|
||||
else
|
||||
return $false;
|
||||
|
||||
Reference in New Issue
Block a user