管理后台->游戏订单->游戏充值--日期检索更新

master
chenxiaojun 5 years ago
commit 98c69ac360

@ -14,6 +14,13 @@ class SpendController extends ThinkController
public function lists() 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'])) { if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', trim($_REQUEST['user_account'])); $map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']); unset($_REQUEST['user_account']);
@ -22,28 +29,6 @@ class SpendController extends ThinkController
$map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%'); $map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%');
unset($_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 (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name'] == '全部') { if ($_REQUEST['game_name'] == '全部') {
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
@ -87,7 +72,6 @@ class SpendController extends ThinkController
$map['promote_id'] = ['in', $promoteIds]; $map['promote_id'] = ['in', $promoteIds];
} }
} }
if ($_REQUEST['data_order'] != '') { if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order'])); $data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(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); $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('list_data', $data['data']);
$this->assign('_page', $data['page']); $this->assign('_page', $data['page']);
$this->display(); $this->display();

@ -48,11 +48,11 @@
<input type="text" name="pay_order_number" class="" value="{:I('pay_order_number')}" placeholder="支付订单号"> <input type="text" name="pay_order_number" class="" value="{:I('pay_order_number')}" placeholder="支付订单号">
</div> </div>
<div class="input-list"> <div class="input-list">
<input type="text" id="time-start" name="time-start" class="" value="{:I('time-start')}" <input type="text" readonly id="time-start" name="time-start" class="" value="{$startDate}"
placeholder="充值开始时间"/> placeholder="充值开始时间"/>
- -
<div class="input-append date" id="datetimepicker" style="display:inline-block"> <div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time-end" class="" value="{:I('time-end')}" <input type="text" readonly id="time-end" name="time-end" class="" value="{$endDate}"
placeholder="充值结束时间"/> placeholder="充值结束时间"/>
<span class="add-on"><i class="icon-th"></i></span> <span class="add-on"><i class="icon-th"></i></span>
</div> </div>

Loading…
Cancel
Save