From 0f8a9df6aa54db1c2a4bdd06b68b2a12eb30522c Mon Sep 17 00:00:00 2001 From: xiaoz Date: Fri, 31 Aug 2018 20:05:51 +0800 Subject: [PATCH] =?UTF-8?q?v1.21=20add=20=E6=8C=89=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/index.php | 8 +++++-- admin/senioradmin.php | 39 ++++++++++++++++++++++++++++++--- functions/class/class.admin.php | 20 ++++++++++++++--- functions/version.txt | 2 +- static/embed.js | 17 ++++++++++++++ tpl/admin/footer.php | 15 ++++++++++++- 6 files changed, 91 insertions(+), 10 deletions(-) diff --git a/admin/index.php b/admin/index.php index 2fb5a77..de0ac6e 100644 --- a/admin/index.php +++ b/admin/index.php @@ -16,14 +16,17 @@
+

数据统计

- - + + + + @@ -31,6 +34,7 @@ + diff --git a/admin/senioradmin.php b/admin/senioradmin.php index 09c4194..e1e7c34 100644 --- a/admin/senioradmin.php +++ b/admin/senioradmin.php @@ -8,14 +8,32 @@ $type = $_GET['type']; //获取页数 $page = $_GET['page']; + //获取时间 + @$date = $_GET['date']; + //如果时间不为空 + if($date != ''){ + $thedate = explode("|",$date); + $starttime = $thedate[0]; + $endtime = $thedate[1]; + //翻页选项 + $thepage = '&date='.$date; + } + else{ + $starttime = ''; + //获取当前日期 + $endtime = date("Y-m-d",time()); + //翻页选项 + $thepage = ''; + } //查询图片 - $imgs = $pic->querypic($type,$page); + $imgs = $pic->querypic($type,$page,$date); $up = (int)$page - 1; if($up <= 0){ $up = 1; } $down = (int)$page +1; + ?>
@@ -27,6 +45,21 @@
+ +
+
累积上传 本月上传数量 今日上传 可疑图片
+ + + + + + + + + +
按时间筛选: -
+
+ @@ -100,8 +133,8 @@ diff --git a/functions/class/class.admin.php b/functions/class/class.admin.php index 0ca211a..bc1df81 100644 --- a/functions/class/class.admin.php +++ b/functions/class/class.admin.php @@ -25,7 +25,15 @@ } } //查询图片 - function querypic($type,$page){ + function querypic($type,$page,$date = null){ + //对时间进行拆分 + if($date != null){ + $date = explode("|",$date); + + $starttime = $date[0]; + $endttime = $date[1]; + } + $config = $this->config; $database = $this->database; @@ -78,7 +86,10 @@ return $datas; break; default: - echo 'dsddsd'; + $sql = "SELECT * FROM imginfo WHERE date(date) BETWEEN '$starttime' AND '$endttime' ORDER BY `id` DESC LIMIT $num OFFSET $start"; + + $datas = $database->query($sql); + return $datas; break; } } @@ -125,12 +136,15 @@ $level = $this->database->count("imginfo",[ "level" => 3 ]); + //统计全部图片 + $all = $this->database->count("imginfo"); //返回数据 $redata = array( "month" => $month, "day" => $day, - "level" => $level + "level" => $level, + "all" => $all ); return $redata; } diff --git a/functions/version.txt b/functions/version.txt index 4435ba7..75ca56c 100644 --- a/functions/version.txt +++ b/functions/version.txt @@ -1 +1 @@ -v1.20(20180811) \ No newline at end of file +v1.21(20180831) \ No newline at end of file diff --git a/static/embed.js b/static/embed.js index aa9ac4c..f67ab5f 100644 --- a/static/embed.js +++ b/static/embed.js @@ -451,4 +451,21 @@ function urlup(){ layer.msg(re.msg); } }); +} + +//时间筛选 +function screen(){ + var starttime = $("#starttime").val(); + var endtime = $("#endtime").val(); + + if((starttime == '') || (endtime == '')){ + layui.use('layer', function(){ + var layer = layui.layer; + layer.msg('请选择时间!'); + }); + } + + else{ + window.location.href = "./senioradmin.php?page=1&date=" + starttime + '|' + endtime; + } } \ No newline at end of file diff --git a/tpl/admin/footer.php b/tpl/admin/footer.php index 55f7543..5962776 100644 --- a/tpl/admin/footer.php +++ b/tpl/admin/footer.php @@ -13,6 +13,19 @@ - + + \ No newline at end of file