From cafa5b61f24a96f337d52ac5752b241ec9a0716d Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Thu, 13 Oct 2022 14:10:17 +0800 Subject: [PATCH] feat(web/image_hosting): show usage statistics --- web/app/controllers/image_hosting/index.php | 139 +++++++++++--------- 1 file changed, 76 insertions(+), 63 deletions(-) diff --git a/web/app/controllers/image_hosting/index.php b/web/app/controllers/image_hosting/index.php index d86685e..6063c55 100644 --- a/web/app/controllers/image_hosting/index.php +++ b/web/app/controllers/image_hosting/index.php @@ -14,7 +14,9 @@ } $limit = $myUser['images_size_limit']; - $used = DB::select("SELECT SUM(size) FROM `users_images` WHERE uploader = {$myUser['username']}")["SUM(size)"]; + $_result = DB::selectFirst("SELECT SUM(size), count(*) FROM `users_images` WHERE uploader = '{$myUser['username']}'"); + $used = $_result["SUM(size)"]; + $count = $_result["count(*)"]; function throwError($msg) { die(json_encode(['status' => 'error', 'message' => $msg])); @@ -120,76 +122,87 @@
-
-
- - 点击此处选择图片 -
- -