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 @@