Last comments respect safety choice
This commit is contained in:
parent
4a9cc4b3bc
commit
56622b8e9d
1 changed files with 11 additions and 3 deletions
|
@ -5,9 +5,17 @@ class CommentSearchService extends AbstractSearchService
|
|||
{
|
||||
$sqlQuery
|
||||
->from('comment')
|
||||
->where('post_id')
|
||||
->is()->not('NULL')
|
||||
->orderBy('id')
|
||||
->innerJoin('post')
|
||||
->on('post_id = post.id');
|
||||
|
||||
$allowedSafety = PrivilegesHelper::getAllowedSafety();
|
||||
if (empty($allowedSafety))
|
||||
$sqlQuery->where('0');
|
||||
else
|
||||
$sqlQuery->where('post.safety')->in()->genSlots($allowedSafety)->put($allowedSafety);
|
||||
|
||||
$sqlQuery
|
||||
->orderBy('comment.id')
|
||||
->desc();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue