diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index 053c722a..2dd2e065 100644 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -45,25 +45,34 @@ class Dashboard extends Backend } $dbTableList = Db::query("SHOW TABLE STATUS"); + $addonList = get_addon_list(); + $totalworkingaddon = 0; + $totaladdon = count($addonList); + foreach ($addonList as $index => $item) { + if ($item['state']) { + $totalworkingaddon += 1; + } + } $this->view->assign([ - 'totaluser' => User::count(), - 'totaladdon' => count(get_addon_list()), - 'totaladmin' => Admin::count(), - 'totalcategory' => \app\common\model\Category::count(), - 'todayusersignup' => User::whereTime('jointime', 'today')->count(), - 'todayuserlogin' => User::whereTime('logintime', 'today')->count(), - 'sevendau' => User::whereTime('jointime|logintime|prevtime', '-7 days')->count(), - 'thirtydau' => User::whereTime('jointime|logintime|prevtime', '-30 days')->count(), - 'threednu' => User::whereTime('jointime', '-3 days')->count(), - 'sevendnu' => User::whereTime('jointime', '-7 days')->count(), - 'dbtablenums' => count($dbTableList), - 'dbsize' => array_sum(array_map(function ($item) { + 'totaluser' => User::count(), + 'totaladdon' => $totaladdon, + 'totaladmin' => Admin::count(), + 'totalcategory' => \app\common\model\Category::count(), + 'todayusersignup' => User::whereTime('jointime', 'today')->count(), + 'todayuserlogin' => User::whereTime('logintime', 'today')->count(), + 'sevendau' => User::whereTime('jointime|logintime|prevtime', '-7 days')->count(), + 'thirtydau' => User::whereTime('jointime|logintime|prevtime', '-30 days')->count(), + 'threednu' => User::whereTime('jointime', '-3 days')->count(), + 'sevendnu' => User::whereTime('jointime', '-7 days')->count(), + 'dbtablenums' => count($dbTableList), + 'dbsize' => array_sum(array_map(function ($item) { return $item['Data_length'] + $item['Index_length']; }, $dbTableList)), - 'attachmentnums' => Attachment::count(), - 'attachmentsize' => Attachment::sum('filesize'), - 'picturenums' => Attachment::where('mimetype', 'like', 'image/%')->count(), - 'picturesize' => Attachment::where('mimetype', 'like', 'image/%')->sum('filesize'), + 'totalworkingaddon' => $totalworkingaddon, + 'attachmentnums' => Attachment::count(), + 'attachmentsize' => Attachment::sum('filesize'), + 'picturenums' => Attachment::where('mimetype', 'like', 'image/%')->count(), + 'picturesize' => Attachment::where('mimetype', 'like', 'image/%')->sum('filesize'), ]); $this->assignconfig('column', array_keys($userlist)); diff --git a/application/admin/lang/zh-cn/dashboard.php b/application/admin/lang/zh-cn/dashboard.php index 0b244d19..66ce16e0 100644 --- a/application/admin/lang/zh-cn/dashboard.php +++ b/application/admin/lang/zh-cn/dashboard.php @@ -1,47 +1,50 @@ '自定义', - 'Pid' => '父ID', - 'Type' => '栏目类型', - 'Image' => '图片', - 'Total user' => '总会员数', - 'Total addon' => '总插件数', - 'Total category' => '总分类数', - 'Total admin' => '总管理员数', - 'Today user signup' => '今日注册', - 'Today user login' => '今日登录', - 'Today order' => '今日订单', - 'Unsettle order' => '未处理订单', - 'Three dnu' => '三日新增', - 'Seven dnu' => '七日新增', - 'Seven dau' => '七日活跃', - 'Thirty dau' => '月活跃', - 'Custom zone' => '这里是你的自定义数据', - 'Register user' => '注册用户数', - 'Real time' => '实时', - 'Category count' => '分类统计', - 'Category count tips' => '当前分类总记录数', - 'Database count' => '数据库统计', - 'Database table nums' => '数据表数量', - 'Database size' => '占用空间', - 'Attachment count' => '附件统计', - 'Attachment nums' => '附件数量', - 'Attachment size' => '附件大小', - 'Attachment count tips' => '当前上传的附件数量', - 'Picture count' => '图片统计', - 'Picture nums' => '图片数量', - 'Picture size' => '图片大小', - 'Server info' => '服务器信息', - 'PHP version' => 'PHP版本', - 'Sapi name' => '运行方式', - 'Debug mode' => '调试模式', - 'Software' => '环境信息', - 'Upload mode' => '上传模式', - 'Upload url' => '上传URL', - 'Upload cdn url' => '上传CDN', - 'Cdn url' => '静态资源CDN', - 'Timezone' => '时区', - 'Language' => '语言', - 'View more' => '查看更多', + 'Custom' => '自定义', + 'Pid' => '父ID', + 'Type' => '栏目类型', + 'Image' => '图片', + 'Total user' => '总会员数', + 'Total addon' => '总插件数', + 'Total category' => '总分类数', + 'Total attachment' => '总附件数', + 'Total admin' => '总管理员数', + 'Today user signup' => '今日注册', + 'Today user login' => '今日登录', + 'Today order' => '今日订单', + 'Unsettle order' => '未处理订单', + 'Three dnu' => '三日新增', + 'Seven dnu' => '七日新增', + 'Seven dau' => '七日活跃', + 'Thirty dau' => '月活跃', + 'Custom zone' => '这里是你的自定义数据', + 'Register user' => '注册用户数', + 'Real time' => '实时', + 'Category count' => '分类统计', + 'Working addon count' => '运行中的插件', + 'Category count tips' => '当前分类总记录数', + 'Working addon count tips' => '当前运行中的插件数', + 'Database count' => '数据库统计', + 'Database table nums' => '数据表数量', + 'Database size' => '占用空间', + 'Attachment count' => '附件统计', + 'Attachment nums' => '附件数量', + 'Attachment size' => '附件大小', + 'Attachment count tips' => '当前上传的附件数量', + 'Picture count' => '图片统计', + 'Picture nums' => '图片数量', + 'Picture size' => '图片大小', + 'Server info' => '服务器信息', + 'PHP version' => 'PHP版本', + 'Sapi name' => '运行方式', + 'Debug mode' => '调试模式', + 'Software' => '环境信息', + 'Upload mode' => '上传模式', + 'Upload url' => '上传URL', + 'Upload cdn url' => '上传CDN', + 'Cdn url' => '静态资源CDN', + 'Timezone' => '时区', + 'Language' => '语言', + 'View more' => '查看更多', ]; diff --git a/application/admin/view/dashboard/index.html b/application/admin/view/dashboard/index.html index c7900b7c..0c04396f 100644 --- a/application/admin/view/dashboard/index.html +++ b/application/admin/view/dashboard/index.html @@ -194,8 +194,8 @@
- {$totalcategory} - {:__('Total category')} + {$attachmentnums} + {:__('Total attachment')}
@@ -293,14 +293,14 @@
{:__('Real time')} -
{:__('Category count')}
+
{:__('Working addon count')}
-

{$totalcategory}

+

{$totalworkingaddon}

- {:__('Category count tips')} + {:__('Working addon count tips')}