diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 326efccd2..f6d51723d 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -31,6 +31,14 @@ class QueryController extends BaseController { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据arraypage + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; if (isset($_REQUEST['row'])) { $row = $_REQUEST['row']; @@ -75,20 +83,9 @@ class QueryController extends BaseController } else { $map['_string'] = '1<>1'; } - - if (!empty(I('own_id'))) { $map['tab_spend.promote_id'] = $queryPromote['id'];//本账号 } - - if (!empty(I('begtime')) && empty(I('endtime'))) { - $map['tab_spend.pay_time'] = ['egt', strtotime(I('begtime'))]; - } elseif (empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_spend.pay_time'] = ['elt', strtotime(I('endtime')) + 86399]; - } elseif (!empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_spend.pay_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]]; - } - if (isset($_REQUEST['pay_way']) && $_REQUEST['pay_way'] !== '') { $payWay = intval(I('pay_way')); @@ -107,23 +104,27 @@ class QueryController extends BaseController empty(I('game_player_name')) || $map['tab_spend.game_player_name'] = ['like', '%' . I('game_player_name') . '%']; empty(I('user_account')) || $map['tab_spend.user_account'] = I('user_account'); empty(I('order_number')) || $map['tab_spend.order_number'] = I('order_number'); + $map['tab_spend.pay_time'] = ['between', [$begTime, $endTime - 1]]; $map['tab_spend.pay_status'] = 1; $map['tab_spend.is_check'] = ['neq', 2]; - $data = M('Spend', 'tab_') - ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') - ->where($map) - ->order('tab_spend.id desc') - ->page($page, $row) - ->select(); - - $count = M('Spend', 'tab_') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->where($map) - ->count(); + $data = []; + $count = 0; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $data = M('Spend', 'tab_') + ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') + ->where($map) + ->order('tab_spend.id desc') + ->page($page, $row) + ->select(); + $count = M('Spend', 'tab_') + ->join('tab_game on tab_spend.game_id = tab_game.id') + ->where($map) + ->count(); + } if (!empty($data)) { foreach ($data as &$list) { $list['p_p_pro_account'] = $list['pro_account']; @@ -159,21 +160,23 @@ class QueryController extends BaseController $strLen = 4; $hideChar = ''; - if($orderLen <=8) { + if ($orderLen <= 8) { $strLen = 2; } - for($i = 0;$i<$orderLen-$strLen*2;$i++) { - $hideChar .='*'; + for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { + $hideChar .= '*'; } - $list['order_number'] = substr($list['order_number'], 0, $strLen) . $hideChar . substr($list['order_number'], $orderLen-$strLen); + $list['order_number'] = substr($list['order_number'], 0, $strLen) . $hideChar . substr($list['order_number'], $orderLen - $strLen); } } //分页 $parameter['p'] = I('get.p', 1); $parameter['row'] = I('get.row'); + $parameter['begtime'] = $initBegTime; + $parameter['endtime'] = $initEndTime; empty(I('relation_game_id')) || $parameter['relation_game_id'] = I('relation_game_id'); empty(I('sdk_version')) || $parameter['sdk_version'] = I('sdk_version'); empty(I('server_id')) || $parameter['server_id'] = I('server_id'); @@ -182,8 +185,6 @@ class QueryController extends BaseController empty(I('team_leader_id')) || $parameter['team_leader_id'] = I('team_leader_id'); empty(I('promote_id')) || $parameter['promote_id'] = I('promote_id'); empty(I('own_id')) || $parameter['own_id'] = I('own_id'); - empty(I('begtime')) || $parameter['begtime'] = I('begtime'); - empty(I('endtime')) || $parameter['endtime'] = I('endtime'); empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2'); empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3'); empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4'); @@ -199,6 +200,8 @@ class QueryController extends BaseController $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); $this->assign('setdate', date("Y-m-d")); $this->assign('serverData', $serverData['data']); $this->assign('thisParentPromoteId', $thisParentPromoteId); @@ -216,6 +219,14 @@ class QueryController extends BaseController { $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据arraypage + $nowTime = date('Y-m-d'); + $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); + $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); + $initEndTime = $nowTime; + $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); + $begTime = strtotime($initBegTime); + $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; if (isset($_REQUEST['row'])) { $row = $_REQUEST['row']; @@ -266,28 +277,25 @@ class QueryController extends BaseController $map['tab_user.promote_id'] = $queryPromote['id'];//本账号 } - if (!empty(I('begtime')) && empty(I('endtime'))) { - $map['tab_user.register_time'] = ['egt', strtotime(I('begtime'))]; - } elseif (empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_user.register_time'] = ['elt', strtotime(I('endtime')) + 86399]; - } elseif (!empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_user.register_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]]; - } - + $map['tab_user.register_time'] = ['between', [$begTime, $endTime - 1]]; empty(I('account')) || $map['tab_user.account'] = I('account'); empty(I('id')) || $map['tab_user.id'] = intval(I('id')); - $data = M('User', 'tab_') - ->field('tab_user.*,tab_promote.real_name as pro_real_name') - ->join('left join tab_promote on tab_user.promote_id = tab_promote.id') - ->where($map) - ->order('tab_user.id desc') - ->page($page, $row) - ->select(); + $data = []; + $count = 0; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $data = M('User', 'tab_') + ->field('tab_user.*,tab_promote.real_name as pro_real_name') + ->join('left join tab_promote on tab_user.promote_id = tab_promote.id') + ->where($map) + ->order('tab_user.id desc') + ->page($page, $row) + ->select(); - $count = M('User', 'tab_') - ->where($map) - ->count(); + $count = M('User', 'tab_') + ->where($map) + ->count(); + } if (!empty($data)) { foreach ($data as &$list) { @@ -307,12 +315,12 @@ class QueryController extends BaseController //分页 $parameter['p'] = I('get.p', 1); $parameter['row'] = I('get.row'); + $parameter['begtime'] = $initBegTime; + $parameter['endtime'] = $initEndTime; empty(I('team_leader_id')) || $parameter['team_leader_id'] = I('team_leader_id'); empty(I('promote_id')) || $parameter['promote_id'] = I('promote_id'); empty(I('own_id')) || $parameter['own_id'] = I('own_id'); empty(I('account')) || $parameter['account'] = I('account'); - empty(I('begtime')) || $parameter['begtime'] = I('begtime'); - empty(I('endtime')) || $parameter['endtime'] = I('endtime'); empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2'); empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3'); empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4'); @@ -324,6 +332,8 @@ class QueryController extends BaseController $this->assign('listData', $data); $this->assign('count', $count); + $this->assign('initBegTime', $initBegTime); + $this->assign('initEndTime', $initEndTime); $this->assign('setdate', date("Y-m-d")); $this->assign('thisParentPromoteId', $thisParentPromoteId); $this->assign('pID', PID); @@ -1740,15 +1750,15 @@ class QueryController extends BaseController $strLen = 3; $hideChar = ''; - if($orderLen <=8) { + if ($orderLen <= 8) { $strLen = 2; } - for($i = 0;$i<$orderLen-$strLen*2;$i++) { - $hideChar .='*'; + for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { + $hideChar .= '*'; } - $records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen-$strLen); + $records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen); } diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html index d879f4942..fefbeb432 100644 --- a/Application/Home/View/default/Query/recharge.html +++ b/Application/Home/View/default/Query/recharge.html @@ -118,11 +118,11 @@