diff --git a/src/SearchServices/Filters/PostFilter.php b/src/SearchServices/Filters/PostFilter.php index c8061595..1311877d 100644 --- a/src/SearchServices/Filters/PostFilter.php +++ b/src/SearchServices/Filters/PostFilter.php @@ -4,9 +4,9 @@ namespace Szurubooru\SearchServices\Filters; class PostFilter extends BasicFilter implements IFilter { const ORDER_ID = 'id'; - const ORDER_FAV_TIME = 'lastFavTime'; const ORDER_FAV_COUNT = 'favCount'; const ORDER_TAG_COUNT = 'tagCount'; + const ORDER_COMMENT_COUNT = 'commentCount'; const ORDER_SCORE = 'score'; const ORDER_LAST_EDIT_TIME = 'lastEditTime'; const ORDER_FILE_SIZE = 'originalFileSize'; diff --git a/src/SearchServices/Parsers/PostSearchParser.php b/src/SearchServices/Parsers/PostSearchParser.php index 33d5b233..0b3851b8 100644 --- a/src/SearchServices/Parsers/PostSearchParser.php +++ b/src/SearchServices/Parsers/PostSearchParser.php @@ -103,18 +103,12 @@ class PostSearchParser extends AbstractSearchParser protected function getOrderColumn($tokenText) { - if ($tokenText === 'id') + if ($tokenText === 'random') + return PostFilter::ORDER_RANDOM; + + elseif ($tokenText === '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') return PostFilter::ORDER_LAST_EDIT_TIME; @@ -124,17 +118,23 @@ class PostSearchParser extends AbstractSearchParser elseif ($tokenText === 'file_size') return PostFilter::ORDER_FILE_SIZE; - elseif ($tokenText === 'random') - return PostFilter::ORDER_RANDOM; + elseif ($tokenText === 'tag_count') + return PostFilter::ORDER_TAG_COUNT; - elseif ($tokenText === 'feature_time') - return PostFilter::ORDER_LAST_FEATURE_TIME; + elseif ($tokenText === 'fav_count') + 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') return PostFilter::ORDER_LAST_COMMENT_TIME; - elseif ($tokenText === 'fav_time') - return PostFilter::ORDER_LAST_FAV_TIME; + elseif ($tokenText === 'feature_time') + return PostFilter::ORDER_LAST_FEATURE_TIME; else throw new NotSupportedException();