From 638ceba6cceecc96e0f8697729ef42ee611d0be4 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 15 Nov 2019 15:40:27 +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 --- .../Controller/SpendController.class.php | 32 ++++++------------- Application/Admin/View/Spend/lists.html | 4 +-- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 5c4574c51..caa56f2f0 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -14,6 +14,13 @@ class SpendController extends ThinkController public function lists() { + $startDate = empty($_REQUEST['time-start']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['time-start']; + $endDate = empty($_REQUEST['time-end']) ? date('Y-m-d') : $_REQUEST['time-end']; + $startTime = strtotime($startDate); + $endTime = strtotime($endDate) + 86399; + $map['pay_time'] = array('BETWEEN', array($startTime, $endTime)); + unset($_REQUEST['time-start']); + unset($_REQUEST['time-end']); if (isset($_REQUEST['user_account'])) { $map['user_account'] = array('like', trim($_REQUEST['user_account'])); unset($_REQUEST['user_account']); @@ -22,28 +29,6 @@ class SpendController extends ThinkController $map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%'); unset($_REQUEST['spend_ip']); } - if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) { - $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1)); - unset($_REQUEST['time-start']); - unset($_REQUEST['time-end']); - } elseif (isset($_REQUEST['time-start'])) { - $map['pay_time'] = ['GT', strtotime(I('time-start'))]; - unset($_REQUEST['time-start']); - } elseif (isset($_REQUEST['time-end'])) { - $map['pay_time'] = ['LT', strtotime(I('time-end')) + 86399]; - unset($_REQUEST['time-end']); - } - if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) { - $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1)); - unset($_REQUEST['start']); - unset($_REQUEST['end']); - } elseif (isset($_REQUEST['start'])) { - $map['pay_time'] = ['GT', strtotime(I('start'))]; - unset($_REQUEST['start']); - } elseif (isset($_REQUEST['end'])) { - $map['pay_time'] = ['LT', strtotime(I('end')) + 86399]; - unset($_REQUEST['end']); - } if (isset($_REQUEST['game_name'])) { if ($_REQUEST['game_name'] == '全部') { unset($_REQUEST['game_name']); @@ -87,7 +72,6 @@ class SpendController extends ThinkController $map['promote_id'] = ['in', $promoteIds]; } } - if ($_REQUEST['data_order'] != '') { $data_order = reset(explode(',', $_REQUEST['data_order'])); $data_order_type = end(explode(',', $_REQUEST['data_order'])); @@ -112,6 +96,8 @@ class SpendController extends ThinkController $data = D(self::model_name)->lists($_GET["p"], $map, $order); + $this->assign('startDate', $startDate); + $this->assign('endDate', $endDate); $this->assign('list_data', $data['data']); $this->assign('_page', $data['page']); $this->display(); diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index 35a762a32..8a0e90e82 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -48,11 +48,11 @@