summaryrefslogtreecommitdiffstats
path: root/application/service/files.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/service/files.php')
-rw-r--r--application/service/files.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/application/service/files.php b/application/service/files.php
index adc62c7dc..c65660b75 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -31,12 +31,12 @@ class files {
}
$total_size = $CI->db->query("
- SELECT coalesce(sum(filesize), 0) sum
+ SELECT coalesce(sum(sub.filesize), 0) sum
FROM (
- SELECT DISTINCT `".$CI->db->dbprefix."file_storage`.id, filesize
- FROM `".$CI->db->dbprefix."file_storage`
- JOIN `".$CI->db->dbprefix."files` ON `".$CI->db->dbprefix."file_storage`.id = `".$CI->db->dbprefix."files`.file_storage_id
- WHERE user = ?
+ SELECT DISTINCT fs.id, filesize
+ FROM ".$CI->db->dbprefix."file_storage fs
+ JOIN ".$CI->db->dbprefix."files f ON fs.id = f.file_storage_id
+ WHERE f.user = ?
) sub
", array($user))->row_array();