gq 7 vuotta sitten
vanhempi
commit
6de67cfcd6
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      server/app/Http/Controllers/Api/V1/DreamController.php

+ 2 - 2
server/app/Http/Controllers/Api/V1/DreamController.php

xqd xqd
@@ -239,7 +239,7 @@ class DreamController extends Controller
             $arr = array_filter(explode(',',$interaction->black_list));
            if(!empty($arr)){
                $interaction->comments = CommentInfoModel::where('interaction_id',$interaction->id)->where(function ($query) use ($arr) {
-                   $query->whereNotIn('user_id',$arr);
+                   $query->whereNotIn('user_id',$arr)->whereNotIn('to_user_id',$arr);
                })->orderBy('created_at')->get()->toArray();
            }else{
                $interaction->comments = CommentInfoModel::where('interaction_id',$interaction->id)->orderBy('created_at')->get()->toArray();
@@ -306,7 +306,7 @@ class DreamController extends Controller
             $arr = array_filter(explode(',',$interaction->black_list));
             if(!empty($arr)){
                 $interaction->comments = CommentInfoModel::where('interaction_id',$interaction->id)->where(function ($query) use ($arr) {
-                    $query->whereNotIn('user_id',$arr);
+                    $query->whereNotIn('user_id',$arr)->whereNotIn('to_user_id',$arr);
                 })->orderBy('created_at')->get()->toArray();
             }else{
                 $interaction->comments = CommentInfoModel::where('interaction_id',$interaction->id)->orderBy('created_at')->get()->toArray();