Prechádzať zdrojové kódy

Merge branch 'develop'

wzq 5 rokov pred
rodič
commit
3bc6ff7537

+ 1 - 8
app/Transformers/Topic/TopicPostTransformer.php

@@ -32,13 +32,6 @@ class TopicPostTransformer extends TransformerAbstract
         foreach($post->imgs as $img){
             $imgs[] = $img['img'];
         }
-        $topic = [];
-        foreach($post->topic() as $key => $val){
-            $topic[] = [
-                'id' => $key,
-                'name' => $val
-            ];
-        }
         $isLike = 0;
         $isDislike = 0;
         $isCollect = 0;
@@ -60,7 +53,7 @@ class TopicPostTransformer extends TransformerAbstract
             'uid' => $post['uid'],
             'username' => $user['username'],
             'avatar' => $user['avatar'],
-            'topic' => $topic,
+            'topic' => $this->getTopic($post['topic_ids']),
             'title' => $post['title'],
             'content' => $post['content'],
             'location' => $post['location'],