Browse Source

话题详情

wzq 5 years ago
parent
commit
793a79c775
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/Transformers/Topic/TopicDetailTransformer.php

+ 4 - 0
app/Transformers/Topic/TopicDetailTransformer.php

@@ -21,6 +21,10 @@ class TopicDetailTransformer extends TransformerAbstract
     {
         return [
             'id' => $topic['id'],
+            'name' => $topic['name'],
+            'img' => $topic['img'],
+            'follow_count' => $topic->follow->count(),
+            'is_follow' => $topic->follow->where('uid', $this->uid)->count()?1:0,
         ];
     }
 }