1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 11:58:41 +08:00

修复评论列表查询条件

This commit is contained in:
koogua 2021-09-28 21:14:15 +08:00
parent 124b28856f
commit 5009ae36a0
3 changed files with 3 additions and 0 deletions

View File

@ -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();

View File

@ -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,
];
}

View File

@ -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,
];
}