|
@@ -90,6 +90,7 @@ class FeedRepositories
|
|
|
}elseif ($feedType==4){//评论
|
|
|
$data['relate_id'] = $request['post_id'];
|
|
|
$content['post_desc'] = $request['post_desc'];
|
|
|
+ $content['comment_id'] = $request['comment_id'];
|
|
|
$content['comment_desc'] = $request['comment_content'];
|
|
|
$content['beans'] = isset($request['rewards']['bean'])?intval($request['rewards']['bean']):0;
|
|
|
$content['post_type'] = $request['post_type'];
|
|
@@ -205,7 +206,14 @@ class FeedRepositories
|
|
|
];
|
|
|
}
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
/**
|