From c0a8410faaf8b212d3a8eb54d69142c60be98ed8 Mon Sep 17 00:00:00 2001 From: wisp-x <1591788658@qq.com> Date: Wed, 28 Aug 2019 08:50:18 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=87=86=E7=A1=AE=E7=9A=84=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/admin/System.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/application/index/controller/admin/System.php b/application/index/controller/admin/System.php index 88afdb30..1a77a634 100644 --- a/application/index/controller/admin/System.php +++ b/application/index/controller/admin/System.php @@ -10,6 +10,7 @@ namespace app\index\controller\admin; use app\common\model\Config; use think\Db; +use app\common\model\Images; use think\Exception; /** @@ -50,14 +51,14 @@ class System extends Base public function console() { - $storage = Db::name('images')->sum('size'); - $imagesCount = Db::name('images')->count(); - $suspiciousImagesCount = Db::name('images')->where('suspicious', 1)->count(); - $users_count = Db::name('users')->count(); - $today = Db::name('images')->whereTime('create_time', 'today')->count(); - $yesterday = Db::name('images')->whereTime('create_time', 'yesterday')->count(); - $month = Db::name('images')->whereTime('create_time', 'month')->count(); - $tourists = Db::name('images')->where('user_id', 0)->count(); + $storage = Images::sum('size'); + $imagesCount = Images::count(); + $suspiciousImagesCount = Images::where('suspicious', 1)->count(); + $users_count = Images::count(); + $today = Images::whereTime('create_time', 'today')->count(); + $yesterday = Images::whereTime('create_time', 'yesterday')->count(); + $month = Images::whereTime('create_time', 'month')->count(); + $tourists = Images::where('user_id', 0)->count(); $this->assign([ 'storage' => format_size($storage, true), // 占用储存