Commit fc97c85154dfa80ad2cd303d3b7caabbba47e9ac
1 parent
120b2445
Exists in
master
and in
111 other branches
Sort by granule_uid by default
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
php/epntap.php
... | ... | @@ -146,9 +146,9 @@ function getNbResults() { |
146 | 146 | } |
147 | 147 | |
148 | 148 | function getGranules() { |
149 | - $sort = is_null(getParam('sort')) ? '' : "ORDER BY " . getParam('sort') . " " . getParam('dir'); | |
149 | + $sort = is_null(getParam('sort')) ? 'granule_uid ASC' : (getParam('sort') . ' ' . getParam('dir')); | |
150 | 150 | $filter = createFilter(getParam('targetName'), getParam('productTypes'), getParam('timeMin'), getParam('timeMax')); |
151 | - $query = "SELECT TOP " . getParam('limit') . " * FROM " . getParam('tableName') . " $filter $sort OFFSET " . getParam('start'); | |
151 | + $query = "SELECT TOP " . getParam('limit') . " * FROM " . getParam('tableName') . " $filter ORDER BY $sort OFFSET " . getParam('start'); | |
152 | 152 | // error_log('getGranules query: ' . $query); |
153 | 153 | $response = request(getParam('url'), $query); |
154 | 154 | if($response['success']) { | ... | ... |