Added :like and :dislike search aliases
This commit is contained in:
parent
34b9a80ba7
commit
fa251e60b6
1 changed files with 2 additions and 2 deletions
|
@ -145,7 +145,7 @@ class PostSearchParser extends AbstractSearchParser
|
|||
{
|
||||
$context = \Chibi\Registry::getContext();
|
||||
$value = strtolower($value);
|
||||
if (in_array($value, ['liked', 'likes']))
|
||||
if (in_array($value, ['like', 'liked', 'likes']))
|
||||
{
|
||||
if (!$this->statement->isTableJoined('post_score'))
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ class PostSearchParser extends AbstractSearchParser
|
|||
return new Sql\EqualsFunctor(new Sql\IfNullFunctor('post_score.score', '0'), '1');
|
||||
}
|
||||
|
||||
elseif (in_array($value, ['disliked', 'dislikes']))
|
||||
elseif (in_array($value, ['dislike', 'disliked', 'dislikes']))
|
||||
{
|
||||
if (!$this->statement->isTableJoined('post_score'))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue