wzq 5 éve
szülő
commit
f67c39b085
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      app/Traits/PostTrait.php

+ 1 - 0
app/Traits/PostTrait.php

@@ -96,6 +96,7 @@ trait PostTrait
                     $isLike = Redis::ZSCORE($key, $uid.'_'.$item->id) ? 1 : 0;
                 }
                 $item->is_like = $isLike;
+                $item->like_count = Redis::ZCOUNT($key, $item->id, $item->id);
             }
         }else{
             $comments = PostComment::where('post_id', $id)->where('parent_id', 0)->orderBy('like_count', 'desc')->orderBy('is_delete', 'asc')->orderBy('id', 'desc')->limit(2)->get();