mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 11:58:41 +08:00
修复评论列表查询条件
This commit is contained in:
parent
124b28856f
commit
5009ae36a0
@ -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();
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user