diff options
-rw-r--r-- | application/controllers/file.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 2b39309bb..6d56fa793 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -391,11 +391,13 @@ class File extends CI_Controller { $lengths[$length_key] = mb_strlen($value); } + $order = is_cli_client() ? "ASC" : "DESC"; + $query = $this->db->query(" SELECT ".implode(",", array_keys($fields))." FROM files WHERE user = ? - ORDER BY date + ORDER BY date $order ", array($user))->result_array(); foreach($query as $key => $item) { |