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
|
$sqlQuery
|
||||||
->from('comment')
|
->from('comment')
|
||||||
->where('post_id')
|
->innerJoin('post')
|
||||||
->is()->not('NULL')
|
->on('post_id = post.id');
|
||||||
->orderBy('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();
|
->desc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue