Fixed small bugs in search services

This commit is contained in:
Marcin Kurczewski 2014-02-24 00:11:01 +01:00
parent 2aefafa473
commit 0b10221fed
2 changed files with 3 additions and 3 deletions

View file

@ -79,7 +79,7 @@ abstract class AbstractSearchParser
}
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)

View file

@ -40,7 +40,7 @@ class PostSearchParser extends AbstractSearchParser
$this->statement->getCriterion()->add($operator);
}
$this->statement->addOrderBy('id',
$this->statement->addOrderBy('post.id',
empty($this->statement->getOrderBy())
? SqlSelectStatement::ORDER_DESC
: $this->statement->getOrderBy()[0][1]);
@ -58,7 +58,7 @@ class PostSearchParser extends AbstractSearchParser
{
$ids = preg_split('/[;,]/', $value);
$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']))