Bugfix: Gesamtsumme der Stimmen auf /beliebt wieder korrekt. Auf Film-Seite, inaktive Nutzer gekennzeichnet.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -70,9 +70,9 @@ class User extends Eloquent implements UserInterface, RemindableInterface {
|
||||
public function setSetting($key, $value) {
|
||||
$settings = json_decode($this->settings);
|
||||
if(is_null($settings)) {
|
||||
$settings = array();
|
||||
$settings = new stdClass();
|
||||
}
|
||||
$settings[$key] = $value;
|
||||
$settings->$key = $value;
|
||||
$this->settings = json_encode($settings);
|
||||
}
|
||||
|
||||
|
@@ -109,7 +109,7 @@
|
||||
<dt>Dafür</dt>
|
||||
<dd>
|
||||
@foreach($pv as $v)
|
||||
<span class="badge">
|
||||
<span class="badge" {{ $v->getSetting('disabled') ? 'style="color: #c77; font-style: italic;"' : '' }}>
|
||||
<img class="img-circle" src="{{ $v->getAvatar() }}" width="20"> {{$v->name}}
|
||||
</span>
|
||||
@endforeach
|
||||
@@ -118,7 +118,7 @@
|
||||
<dt>Nicht dafür</dt>
|
||||
<dd>
|
||||
@foreach($nv as $v)
|
||||
<span class="badge">
|
||||
<span class="badge" {{ $v->getSetting('disabled') ? 'style="color: #c77; font-style: italic"' : '' }}>
|
||||
<img class="img-circle" src="{{ $v->getAvatar() }}" width="20"> {{$v->name}}
|
||||
</span>
|
||||
@endforeach
|
||||
|
@@ -27,7 +27,7 @@
|
||||
$vp = $film->upvotes;
|
||||
$np = $film->downvotes;
|
||||
?>
|
||||
<span class="glyphicon glyphicon-transfer"></span> {{ $vp + $np }}
|
||||
<span class="glyphicon glyphicon-transfer"></span> {{ $np != null ? $vp + $np : $film->votes }}
|
||||
</td>
|
||||
<td>
|
||||
@if(($vp) > 0) <span class="label label-default">+{{$vp}}</span>
|
||||
|
Reference in New Issue
Block a user