Fixed small bugs in search services
This commit is contained in:
parent
2aefafa473
commit
0b10221fed
2 changed files with 3 additions and 3 deletions
|
@ -79,7 +79,7 @@ abstract class AbstractSearchParser
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->processOrderToken($orderByString, $orderDir))
|
if (!$this->processOrderToken($orderByString, $orderDir))
|
||||||
throw new SimpleException('Invalid search order type: ' . $orderbyString);
|
throw new SimpleException('Invalid search order type: ' . $orderByString);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processComplexToken($key, $value, $neg)
|
protected function processComplexToken($key, $value, $neg)
|
||||||
|
|
|
@ -40,7 +40,7 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
$this->statement->getCriterion()->add($operator);
|
$this->statement->getCriterion()->add($operator);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->statement->addOrderBy('id',
|
$this->statement->addOrderBy('post.id',
|
||||||
empty($this->statement->getOrderBy())
|
empty($this->statement->getOrderBy())
|
||||||
? SqlSelectStatement::ORDER_DESC
|
? SqlSelectStatement::ORDER_DESC
|
||||||
: $this->statement->getOrderBy()[0][1]);
|
: $this->statement->getOrderBy()[0][1]);
|
||||||
|
@ -58,7 +58,7 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
{
|
{
|
||||||
$ids = preg_split('/[;,]/', $value);
|
$ids = preg_split('/[;,]/', $value);
|
||||||
$ids = array_map('intval', $ids);
|
$ids = array_map('intval', $ids);
|
||||||
return SqlInOperator::fromArray('id', SqlBinding::fromArray($ids));
|
return SqlInOperator::fromArray('post.id', SqlBinding::fromArray($ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif (in_array($key, ['fav', 'favs']))
|
elseif (in_array($key, ['fav', 'favs']))
|
||||||
|
|
Loading…
Reference in a new issue