推广平台->数据管理->订单查询|注册明细--优化

master
chenxiaojun 5 years ago
commit 395cd01d0d

@ -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,9 +104,13 @@ 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 = [];
$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')
@ -123,7 +124,7 @@ class QueryController extends BaseController
->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'];
@ -174,6 +175,8 @@ class QueryController extends BaseController
//分页
$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,17 +277,13 @@ 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 = [];
$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')
@ -288,6 +295,7 @@ class QueryController extends BaseController
$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);

@ -118,11 +118,11 @@
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">起止时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{:I('begtime')}">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="endtime" placeholder="结束时间" value="{:I('endtime')}">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
@ -370,12 +370,17 @@
});
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();
if (Date.parse(sdate) > Date.parse(edate)) {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();

@ -48,7 +48,6 @@
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/register',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<include file="Public/promote_select" />
<div class="form-group normal_space">
@ -64,16 +63,17 @@
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">起止时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{:I('begtime')}">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{:I('endtime')}">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space">
<input type="submit" class="submit normal_space" value="查询">
<input type="submit" class="submit" id='submit' url="{:U('Query/register','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space" style="margin-left: 46px;">
@ -82,7 +82,6 @@
<input type="hidden" name="own_id" id="own_id" value="{:empty(I('own_id'))?0:I('own_id')}" />
</label>
</div>
</form>
</div>
</div>
<div class="page-list query-register-list">
@ -241,12 +240,17 @@
$(".select_gallery").select2();
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();
if (Date.parse(sdate) > Date.parse(edate)) {
var sdate = Date.parse($('#sdate').val()) / 1000;
var edate = Date.parse($('#edate').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();

Loading…
Cancel
Save