From 55fe6a2c7d3e4ed3cb7858cacec91e9cd0b3beeb Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 15 Nov 2019 15:48:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0->=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E8=AE=A2=E5=8D=95->=E6=B8=B8=E6=88=8F=E5=85=85?= =?UTF-8?q?=E5=80=BC--=E6=97=A5=E6=9C=9F=E6=A3=80=E7=B4=A2=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/SpendController.class.php | 10 ++++++++-- Application/Admin/View/Spend/lists.html | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index caa56f2f0..4a4a84e8c 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -83,8 +83,14 @@ class SpendController extends ThinkController $order = ' pay_time desc '; } - $map1 = $map; - $map1['pay_status'] = 1; + if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) { + $map1 = $map; + $map1['pay_status'] = 1; + } else { + $map = '1 = 2'; + $map1 = $map; + } + $total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount')); $ttotal = null_to_0(D(self::model_name)->where('pay_time' . total(1))->where(array('pay_status' => 1))->sum('pay_amount')); $ytotal = null_to_0(D(self::model_name)->where('pay_time' . total(5))->where(array('pay_status' => 1))->sum('pay_amount')); diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 8a0e90e82..c63b9fc4c 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -280,6 +280,17 @@ $(function () { //搜索功能 $("#search").click(function () { + var sdate = Date.parse($('#time-start').val()) / 1000; + var edate = Date.parse($('#time-end').val()) / 1000; + if (sdate > edate) { + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + if ((edate - sdate) > 2592000) { + layer.msg('时间间隔不能超过31天,请重新选择日期'); + return false; + } + var url = $(this).attr('url'); var query = $('.jssearch').find('input').serialize(); query += "&" + $('.jssearch').find('select').serialize();