summaryrefslogtreecommitdiffstats
path: root/application/service
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-20 16:03:22 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-20 16:03:22 +0200
commit7da9de48d2b3bbb0309d6311e4dc7d275d3bf26d (patch)
treebc90956bccaad107255e350ed29cad242eede5cc /application/service
parentf149a0d1abb4a79b1d5de9ddb5963b2eab4b126d (diff)
parente79c1c45dcd23dde1f4b072993829cc008f4858b (diff)
Merge branch 'postgres' into dev
Diffstat (limited to 'application/service')
-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();