diff --git a/app/admin/common.php b/app/admin/common.php index d5d2db3..d79398d 100644 --- a/app/admin/common.php +++ b/app/admin/common.php @@ -223,6 +223,21 @@ function hour_document($arrData) return $documents; } +//访问按日期归档统计 +function date_document($arrData) +{ + $documents = array(); + foreach ($arrData as $index => $value) { + $archivesTime = date("Y-m-d", $value['create_time']); + if (empty($documents[$archivesTime])) { + $documents[$archivesTime] = 1; + } else { + $documents[$archivesTime] += 1; + } + } + return $documents; +} + /** * 管理员操作日志 * @param string $type 操作类型 login add edit view delete diff --git a/app/admin/controller/Api.php b/app/admin/controller/Api.php index 3666c79..c835425 100644 --- a/app/admin/controller/Api.php +++ b/app/admin/controller/Api.php @@ -304,14 +304,19 @@ class Api extends BaseController { $param = get_params(); $first_time = time(); - $second_time = time() - 86400; + $second_time = $first_time - 86400; + $three_time = $first_time - 86400*365; $begin_first = strtotime(date('Y-m-d', $first_time) . " 00:00:00"); $end_first = strtotime(date('Y-m-d', $first_time) . " 23:59:59"); $begin_second = strtotime(date('Y-m-d', $second_time) . " 00:00:00"); $end_second = strtotime(date('Y-m-d', $second_time) . " 23:59:59"); + $begin_three = strtotime(date('Y-m-d', $three_time) . " 00:00:00"); $data_first = Db::name('UserLog')->field('create_time')->whereBetween('create_time', "$begin_first,$end_first")->select(); $data_second = Db::name('UserLog')->field('create_time')->whereBetween('create_time', "$begin_second,$end_second")->select(); - return to_assign(0, '', ['data_first' => hour_document($data_first), 'data_second' => hour_document($data_second)]); + + $data_three = Db::name('UserLog')->field('create_time')->whereBetween('create_time', "$begin_three,$end_first")->select(); + + return to_assign(0, '', ['data_first' => hour_document($data_first), 'data_second' => hour_document($data_second), 'data_three'=>date_document($data_three)]); } } diff --git a/app/admin/view/index/main.html b/app/admin/view/index/main.html index b22c2db..2fbf5c8 100644 --- a/app/admin/view/index/main.html +++ b/app/admin/view/index/main.html @@ -2,231 +2,173 @@ {block name="style"} {/block} {block name="body"} -
提醒:发现app目录下的install文件夹没删除,为了系统的安全,请手动去删除。 | -|
服务器系统 | -{:get_system_info('os')} | -
PHP版本 | -{:get_system_info('php')} | -
系统版本 | -{:CMS_VERSION} | -
ThinkPHP版本 | -{:TP_VERSION}TP6文档 | -
Layui版本 | -{:LAYUI_VERSION}Layui文档 | -
上传附件限制 | -{:get_system_info('upload_max_filesize')} | -
执行时间限制 | -{:get_system_info('max_execution_time')} | -
BUG反馈 | -hdm58@qq.com | -
- 系统用户
- {$adminCount}
- |
-
- 注册用户
- {$userCount}
- |
-
- 文章
- {$articleCount}
- |
-
- 图片
- 0
- |
-
- 产品
- 0
- |
-
用户名 | -头像 | -登录次数 | -最后登录时间 | -
---|
文章标题 | -文章分类 | -发布时间 | -
---|
+ 系统用户
+ {$adminCount}
+ |
+
+ 注册用户
+ {$userCount}
+ |
+
+ 文章
+ {$articleCount}
+ |
+
+ 图片
+ 0
+ |
+
+ 产品
+ 0
+ |
+
提醒:发现app目录下的install文件夹没删除,为了系统的安全,请手动去删除。 | +|
服务器系统 | +{:get_system_info('os')} | +
PHP版本 | +{:get_system_info('php')} | +
勾股博客版本 | +{:CMS_VERSION}勾股CMS | +
ThinkPHP版本 | +{:TP_VERSION}TP6文档 | +
Layui版本 | +{:LAYUI_VERSION}Layui文档 | +
上传附件限制 | +{:get_system_info('upload_max_filesize')} | +
执行时间限制 | +{:get_system_info('max_execution_time')} | +
BUG反馈 | +hdm58@qq.com | +