diff --git a/app/Services/Logic/Article/CommentList.php b/app/Services/Logic/Article/CommentList.php index 266ad84b..be2cb373 100644 --- a/app/Services/Logic/Article/CommentList.php +++ b/app/Services/Logic/Article/CommentList.php @@ -31,6 +31,7 @@ class CommentList extends LogicService $params['item_id'] = $article->id; $params['item_type'] = CommentModel::ITEM_ARTICLE; $params['published'] = CommentModel::PUBLISH_APPROVED; + $params['deleted'] = 0; $sort = $pagerQuery->getSort(); $page = $pagerQuery->getPage(); diff --git a/app/Services/Logic/Comment/ListTrait.php b/app/Services/Logic/Comment/ListTrait.php index 89df1416..68534643 100644 --- a/app/Services/Logic/Comment/ListTrait.php +++ b/app/Services/Logic/Comment/ListTrait.php @@ -77,6 +77,7 @@ trait ListTrait foreach ($comments as $comment) { $result[$comment['id']] = [ 'liked' => in_array($comment['id'], $likedIds) ? 1 : 0, + 'owned' => $comment['owner_id'] == $user->id ? 1 : 0, ]; } diff --git a/app/Services/Logic/Question/AnswerList.php b/app/Services/Logic/Question/AnswerList.php index 8f5bff83..71a79a3d 100644 --- a/app/Services/Logic/Question/AnswerList.php +++ b/app/Services/Logic/Question/AnswerList.php @@ -108,6 +108,7 @@ class AnswerList extends LogicService foreach ($answers as $answer) { $result[$answer['id']] = [ 'liked' => in_array($answer['id'], $likedIds) ? 1 : 0, + 'owned' => $answer['owner_id'] == $user->id ? 1 : 0, ]; }