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