Fixed duplicate and missing search orders
This commit is contained in:
parent
fadd37fe84
commit
5187d3a788
2 changed files with 17 additions and 17 deletions
|
@ -4,9 +4,9 @@ namespace Szurubooru\SearchServices\Filters;
|
||||||
class PostFilter extends BasicFilter implements IFilter
|
class PostFilter extends BasicFilter implements IFilter
|
||||||
{
|
{
|
||||||
const ORDER_ID = 'id';
|
const ORDER_ID = 'id';
|
||||||
const ORDER_FAV_TIME = 'lastFavTime';
|
|
||||||
const ORDER_FAV_COUNT = 'favCount';
|
const ORDER_FAV_COUNT = 'favCount';
|
||||||
const ORDER_TAG_COUNT = 'tagCount';
|
const ORDER_TAG_COUNT = 'tagCount';
|
||||||
|
const ORDER_COMMENT_COUNT = 'commentCount';
|
||||||
const ORDER_SCORE = 'score';
|
const ORDER_SCORE = 'score';
|
||||||
const ORDER_LAST_EDIT_TIME = 'lastEditTime';
|
const ORDER_LAST_EDIT_TIME = 'lastEditTime';
|
||||||
const ORDER_FILE_SIZE = 'originalFileSize';
|
const ORDER_FILE_SIZE = 'originalFileSize';
|
||||||
|
|
|
@ -103,18 +103,12 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
|
|
||||||
protected function getOrderColumn($tokenText)
|
protected function getOrderColumn($tokenText)
|
||||||
{
|
{
|
||||||
if ($tokenText === 'id')
|
if ($tokenText === 'random')
|
||||||
|
return PostFilter::ORDER_RANDOM;
|
||||||
|
|
||||||
|
elseif ($tokenText === 'id')
|
||||||
return PostFilter::ORDER_ID;
|
return PostFilter::ORDER_ID;
|
||||||
|
|
||||||
elseif ($tokenText === 'fav_time')
|
|
||||||
return PostFilter::ORDER_FAV_TIME;
|
|
||||||
|
|
||||||
elseif ($tokenText === 'fav_count')
|
|
||||||
return PostFilter::ORDER_FAV_COUNT;
|
|
||||||
|
|
||||||
elseif ($tokenText === 'tag_count')
|
|
||||||
return PostFilter::ORDER_TAG_COUNT;
|
|
||||||
|
|
||||||
elseif ($tokenText === 'time')
|
elseif ($tokenText === 'time')
|
||||||
return PostFilter::ORDER_LAST_EDIT_TIME;
|
return PostFilter::ORDER_LAST_EDIT_TIME;
|
||||||
|
|
||||||
|
@ -124,17 +118,23 @@ class PostSearchParser extends AbstractSearchParser
|
||||||
elseif ($tokenText === 'file_size')
|
elseif ($tokenText === 'file_size')
|
||||||
return PostFilter::ORDER_FILE_SIZE;
|
return PostFilter::ORDER_FILE_SIZE;
|
||||||
|
|
||||||
elseif ($tokenText === 'random')
|
elseif ($tokenText === 'tag_count')
|
||||||
return PostFilter::ORDER_RANDOM;
|
return PostFilter::ORDER_TAG_COUNT;
|
||||||
|
|
||||||
elseif ($tokenText === 'feature_time')
|
elseif ($tokenText === 'fav_count')
|
||||||
return PostFilter::ORDER_LAST_FEATURE_TIME;
|
return PostFilter::ORDER_FAV_COUNT;
|
||||||
|
|
||||||
|
elseif ($tokenText === 'comment_count')
|
||||||
|
return PostFilter::ORDER_COMMENT_COUNT;
|
||||||
|
|
||||||
|
elseif ($tokenText === 'fav_time')
|
||||||
|
return PostFilter::ORDER_LAST_FAV_TIME;
|
||||||
|
|
||||||
elseif ($tokenText === 'comment_time')
|
elseif ($tokenText === 'comment_time')
|
||||||
return PostFilter::ORDER_LAST_COMMENT_TIME;
|
return PostFilter::ORDER_LAST_COMMENT_TIME;
|
||||||
|
|
||||||
elseif ($tokenText === 'fav_time')
|
elseif ($tokenText === 'feature_time')
|
||||||
return PostFilter::ORDER_LAST_FAV_TIME;
|
return PostFilter::ORDER_LAST_FEATURE_TIME;
|
||||||
|
|
||||||
else
|
else
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
|
Loading…
Reference in a new issue