|
@@ -205,7 +205,14 @@ class FeedRepositories
|
|
];
|
|
];
|
|
}
|
|
}
|
|
public function getPostComment($post_id){
|
|
public function getPostComment($post_id){
|
|
- return $this->postComment->where(['post_id'=>$post_id,'parent_id'=>0,'is_delete'=>0 ])->select('id','uid','username','content')->orderBy('id','desc')->take(2)->get();
|
|
|
|
|
|
+ $comments = $this->postComment->where(['post_id'=>$post_id,'parent_id'=>0])->select('id','uid','username','content','is_delete')->orderBy('is_delete', 'asc')->orderBy('id', 'desc')->take(2)->get();
|
|
|
|
+ foreach($comments as &$comment){
|
|
|
|
+ if($comment->is_delete){
|
|
|
|
+ $comment->content = '该评论已被删除';
|
|
|
|
+ }
|
|
|
|
+ unset($comment->is_delete);
|
|
|
|
+ }
|
|
|
|
+ return $comments;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|