master
elf 11 months ago
parent 4662185cc4
commit 681e6e5169

@ -120,6 +120,8 @@ class QueryController extends BaseController
$map['tab_spend.pay_way'] = $payWay;
}
}
} else {
$map['tab_spend.pay_way'] = ['not in', [41]];
}
if (isset($_REQUEST['pay_status']) && $_REQUEST['pay_status'] !== '') {
$payStatus = intval(I('pay_status'));
@ -267,6 +269,223 @@ class QueryController extends BaseController
$this->display();
}
public function rechargeMine($p = 0)
{
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$ownId = intval(I('own_id'), 0); //本账号
$relationGameId = intval(I('relation_game_id', 0));
$sdkVersion = intval(I('sdk_version', 0));
$serverId = trim(I('server_id', ''));
$gamePlayerName = trim(I('game_player_name', ''));
$userAccount = trim(I('user_account', ''));
$payOrderNumber = trim(I('pay_order_number', ''));
$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;
$payedBegTime = I("payed_begtime", '');
if ($payedBegTime) $payedBegTime = strtotime($payedBegTime);
$payedEndTime = I("payed_endtime", '');
if ($payedEndTime) {
$payedEndTime = strtotime($payedEndTime) + 3600 * 24;
}
if ($payedBegTime && $payedEndTime) {
if (!I('begtime', '') && !I('endtime', '')) {
$initBegTime = '';
$initEndTime = '';
$begTime = 0;
$endTime = 0;
}
}
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$loginPromote = $this->getLoginPromote();
$map = [];
if ($ownId) {
$map['tab_spend.promote_id'] = $queryPromote['id'];
} else {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $queryPromote['id'];
$map = [];
$map['tab_spend.promote_id'] = ['in', $ids];
}
if (!empty($relationGameId)) {
$map['tab_game.relation_game_id'] = $relationGameId;
}
if (!empty($sdkVersion)) {
$map['tab_game.sdk_version'] = $sdkVersion;
}
if (!empty($serverId)) {
$map['tab_spend.server_id'] = $serverId;
}
if (!empty($gamePlayerName)) {
$map['tab_spend.game_player_name'] = $gamePlayerName;
}
if (!empty($userAccount)) {
$map['tab_spend.user_account'] = $userAccount;
}
if (!empty($payOrderNumber)) {
$map['tab_spend.pay_order_number'] = $payOrderNumber;
}
$map['tab_spend.pay_way'] = ['in', [41]];
if (isset($_REQUEST['pay_real_status']) && $_REQUEST['pay_real_status'] !== '') {
$payStatus = intval(I('pay_real_status'));
if (in_array($payStatus, array_keys(QueryController::$payStatus))) {
$map['tab_spend.pay_real_status'] = $payStatus;
}
}
if ($begTime && $endTime) {
$map['tab_spend.spend_time'] = ['between', [$begTime, $endTime - 1]];
}
if ($payedBegTime && $payedEndTime) {
$map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]];
}
$map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check');
$data = [];
$count = 0;
$aggregation = [
'cost' => '0.00',
'pay_amount' => '0.00',
'discount_amount' => '0.00',
];
if (
intval($endTime - $begTime) / (24 * 3600) <= 31
|| intval($payedEndTime - $payedBegTime) / (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,tab_promote.level,tab_promote.parent_id')
->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();
$aggregation = M('Spend', 'tab_')
->field('sum(tab_spend.cost) as cost, sum(tab_spend.pay_amount) as pay_amount, sum(tab_spend.discount_amount) as discount_amount')
->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')
->find();
}
if (!empty($data)) {
$promoteIdData = [];
foreach ($data as $list) {
switch ($list['level']) {
case 3:
$promoteIdData[] = $list['parent_id'];
break;
case 4:
$promoteIdData[] = $list['parent_id'];
$chain = trim($list['chain'], '/');
$chainArr = explode('/', $chain);
$promoteIdData[] = $chainArr[1];
break;
}
}
$promoteData = [];
if (!empty($promoteIdData)) {
$promoteIdData = array_unique($promoteIdData);
$promoteData = M('promote', 'tab_')->where(array('id' => ['in', $promoteIdData]))->getField('id,account,real_name,group_remark');
}
foreach ($data as &$list) {
switch ($list['level']) {
case 1:
case 2:
$list['p_p_pro_account'] = $list['pro_account'];
$list['p_p_pro_real_name'] = $list['pro_real_name'];
$list['p_pro_account'] = $list['pro_account'];
$list['p_pro_real_name'] = $list['pro_real_name'];
break;
case 3:
$list['p_p_pro_account'] = $promoteData[$list['parent_id']]['account'];
$list['p_p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name'];
$list['p_pro_account'] = $list['pro_account'];
$list['p_pro_real_name'] = $list['pro_real_name'];
break;
case 4:
$promoteIdData[] = $list['parent_id'];
$chain = trim($list['chain'], '/');
$chainArr = explode('/', $chain);
$list['p_p_pro_account'] = $promoteData[$chainArr[1]]['account'];
$list['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name'];
$list['p_p_pro_group_remark'] = $promoteData[$chainArr[1]]['group_remark'];
$list['p_pro_account'] = $promoteData[$list['parent_id']]['account'];
$list['p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name'];
$list['p_pro_group_remark'] = $promoteData[$list['parent_id']]['group_remark'];
break;
}
$list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote);
$list['spend_time'] = date('Y-m-d H:i:s', $list['spend_time']);
$list['pay_time'] = ($list['pay_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--';
$list['pay_status'] = isset(QueryController::$payStatus[$list['pay_status']]) ? QueryController::$payStatus[$list['pay_status']] : '未知状态';
$list['sdk_version'] = getSDKTypeName($list['sdk_version']);
$list['pay_order_number'] = hideOrderNumber($list['pay_order_number']);
}
}
//分页
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$parameter['payed_begtime'] = I("payed_begtime", '');
$parameter['payed_endtime'] = I("payed_endtime", '');
$parameter['relation_game_id'] = $relationGameId;
$parameter['sdk_version'] = $sdkVersion;
$parameter['server_id'] = $serverId;
$parameter['game_player_name'] = $gamePlayerName;
$parameter['user_account'] = $userAccount;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['own_id'] = $ownId;
$parameter['level_promote_2'] = $levelPromote[0];
$parameter['level_promote_3'] = $levelPromote[1];
$parameter['level_promote_4'] = $levelPromote[2];
!isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way');
!isset($_REQUEST['pay_status']) || $parameter['pay_status'] = I('pay_status', -1);
$serverData = $this->getServer(I('relation_game_id'), I('sdk_version'));
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('aggregation', $aggregation);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('payedBegTime', I("payed_begtime", ''));
$this->assign('payedEndTime', I("payed_endtime", ''));
$this->assign('setdate', date("Y-m-d"));
$this->assign('serverData', $serverData['data']);
$this->assign('ownId', $ownId);
$this->assign('payWayData', QueryController::$payWay);
$this->assign('payStatusData', QueryController::$payStatus);
$this->meta_title = "订单查询";
$this->display();
}
public function register($p = 0)
{
$page = intval(I('p', 1));

@ -0,0 +1,472 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
</block>
<block name="body">
<style>
@media screen and (max-width: 1500px) {
.normal_form {
padding-top: 45px;
}
.trunk-search .normal_txt {
width: 100px
}
.select2-container--default .select2-selection--single {
width: 125px;
}
.trunk-search .select-time .txt {
width: 100px;
}
.form-group .submit {
width: 55px;
}
}
.normal_space {
margin-left: 0;
margin-right: 10px;
margin-bottom: 10px;
}
.selected-color {
color: #2bd8ed;
}
.pointer-hand {
cursor: pointer;
}
.icon-spend {
position: relative;
font-size: 1.2rem;
top: 3px;
float: right;
right: 10px;
}
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.form-group .txt {
width: 180px;
height: 34px;
}
</style>
<div class="page-search normal_list query-recharge-search jssearch">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>订单查询</span></div>
</div>
<img src="__IMG__/20180207/icon_chongzhi.png">
<span class="title_main">订单数据</span>
<span class="details">对所有渠道用户玩家产生的订单信息,进行记录的功能</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<include file="Public/promote_select" />
<div class="form-group normal_space">
<select id="relation_game_id" name="relation_game_id" class="reselect select_gallery">
<option value="0">请选择游戏</option>
<volist name=":get_promote_serach_game()" id="vo">
<option value="{$vo.relation_game_id}" title="{$vo.relation_game_name}">{$vo.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width:215px;">
<option value="0">请选择设备类型</option>
<volist name=":getSDKType()" id="vo" key="k">
<option value="{$k}">{$vo}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="server_id" name="server_id" class=" reselect select_gallery">
<option value="0">请选择区服</option>
<volist name="serverData" id="vo">
<option value="{$vo.server_id}">{$vo.server_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<input type="text" name="game_player_name" class="txt normal_txt" placeholder="请输入角色名"
value="{:I('game_player_name')}">
</div>
<div class="form-group normal_space">
<input type="text" name="user_account" class="txt normal_txt" id="uid" placeholder="请输入玩家账号"
value="{:I('user_account')}">
</div>
<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="{$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="{$initEndTime}">
</div>
</div>
<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="payed_sdate" class="txt" name="payed_begtime" placeholder="开始时间" value="{$payedBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="payed_edate" class="txt" name="payed_endtime" placeholder="结束时间" value="{$payedEndTime}">
</div>
</div>
<div class="form-group normal_space">
<input type="text" name="pay_order_number" class="txt normal_txt" placeholder="请输入订单号"
value="{:I('pay_order_number')}">
</div>
<div class="form-group normal_space">
<select id="pay_real_status" name="pay_real_status" class="reselect select_gallery" style="min-width:130px;">
<option value="-1">充值状态</option>
<foreach name="payStatusData" item="vo" key="k">
<if condition="$k eq I('pay_real_status',-1)">
<option value="{$k}" selected>{$vo}</option>
<else/>
<option value="{$k}">{$vo}</option>
</if>
</foreach>
</select>
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/recharge','model='.$model['name'],false)}"
value="查询">
</div>
<div class="form-group normal_space" style="margin-left: 46px;">
<label style="line-height: 34px;cursor: pointer;" id="own">
<i class="iconfont {:empty(I('own_id'))?'iconfangxingweixuanzhong':'iconfangxingxuanzhongfill selected-color'}" style="font-size: 1.5rem;position: relative;top: 3px;margin-right: 2px;"></i>本账号
<input type="checkbox" name="own_id" id="own_id" style="display: none;" value="1"
<if condition="$ownId eq 1"> checked="checked" </if> />
</label>
</div>
<!-- <input type="hidden" name="version" value="{:I('version',1)}"> -->
<!-- </form>-->
</div>
</div>
<div class="page-list apply-app_apply-list query-recharge-list">
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<tr class="odd">
<th>玩家账号</th>
<th>游戏订单</th>
<th>支付方式</th>
<th>充值状态</th>
<th>订单金额</th>
<!-- <th>折扣金额</th> -->
<th>实付金额</th>
<th>游戏名称</th>
<th>设备类型</th>
<th>区服ID</th>
<th>区服</th>
<th>角色名</th>
<th>部门长</th>
<th>组长</th>
<th>推广员</th>
<th>下单时间</th>
<th>到账时间</th>
<!-- <th>操作</th>-->
</tr>
<empty name="listData">
<tr class="num2">
<td colspan="10" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td title="玩家ID{$vo.user_id}">{$vo.user_account}</td>
<td>{$vo.pay_order_number}</td>
<td>{:get_pay_way($vo['pay_way'])}</td>
<td>{$vo.pay_status}</td>
<td>{$vo.cost}</td>
<!-- <td>{$vo.discount_amount}</td> -->
<td>{$vo.pay_amount}</td>
<td>{$vo.game_name}</td>
<td>{$vo.sdk_version}</td>
<td>{$vo.server_id}</td>
<td>{$vo.server_name}</td>
<td>{$vo.game_player_name}</td>
<td>{$vo.p_p_pro_account}({$vo.p_p_pro_real_name}/{$vo.p_p_pro_group_remark})</td>
<td>{$vo.p_pro_account}({$vo.p_pro_real_name}/{$vo.p_pro_group_remark})</td>
<td>{$vo.pro_account}({$vo.pro_real_name})</td>
<td>{$vo.spend_time}</td>
<td>{$vo.pay_time}</td>
<!-- <td>-->
<!-- <a href="{:U('Query/viewSpendDetailed',array('id'=>$vo['id']))}" style="cursor: pointer"-->
<!-- class="chakan">查看详细</a>-->
<!-- </td>-->
</tr>
</volist>
<tr>
<td>合计(此数据根据充值状态进行统计)</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>{$aggregation.cost}</td>
<!-- <td>{$aggregation.discount_amount}</td> -->
<td>{$aggregation.pay_amount}</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
</tr>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/recharge_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$_page}
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/my-time-picker/css/bootstrap-datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/my-time-picker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/my-time-picker/js/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
var promoteUrl = "{:U('Query/getSubPromotes')}"
initPromoteSelect(promoteUrl)
$().ready(function () {
setValue('relation_game_id', {$Think.request.relation_game_id |default = '""'});
setValue('sdk_version', {$Think.request.sdk_version |default = '""'});
setValue('server_id', {$Think.request.server_id |default = '""'});
setValue('row', '{:I("get.row",10)}');
var date = "{$setdate}";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: true,
endDate: date,
clearBtn: true,
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date,
clearBtn: true
});
$('#payed_sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date,
clearBtn: true
});
$('#payed_edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date,
clearBtn: true
});
function showPromoteSelect(html)
{
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
$('#own').on('click',function () {
var own = $('#own_id');
var checkBox = $(this).children('i');
if (own.is(':checked')) {
checkBox.removeClass('iconfangxingxuanzhongfill');
checkBox.removeClass('selected-color');
checkBox.addClass('iconfangxingweixuanzhong');
own.prop('checked', false);
} else {
checkBox.removeClass('iconfangxingweixuanzhong');
checkBox.addClass('iconfangxingxuanzhongfill');
checkBox.addClass('selected-color');
own.prop('checked', true);
}
});
$('#relation_game_id').change(function () {
var relationGameId = $(this).val();
var sdkVersion = $('#sdk_version').val();
getServerList(relationGameId, sdkVersion);
});
$('#sdk_version').change(function () {
var sdkVersion = $(this).val();
var relationGameId = $('#relation_game_id').val();
if (relationGameId > 0) {
getServerList(relationGameId, sdkVersion);
}
});
function getServerList(relationGameId, sdkVersion)
{
$.ajax({
url: "{:U('getServerAjax')}",
type: "post",
data: {relation_game_id: relationGameId,sdk_version:sdkVersion},
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>请选择区服</option>";
if (data.status == 1) {
var serverData = data.data;
if (serverData.length > 0) {
for (var i in serverData) {
html += "<option value='" + serverData[i]['server_id'] + "'>" + serverData[i]['server_name'] + "</option>";
}
}
}
$("#server_id").empty();
$('#server_id').html(html);
$("#server_id").select2();
}
})
}
$("#pagehtml a").on("click", function (event) {
event.preventDefault();//使a自带的方法失效即无法调整到href中的URL(http://www.baidu.com)
var geturl = $(this).attr('href');
$('#data_form').attr('action', geturl);
$('#data_form').submit();
});
$('#submit').click(function () {
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 payed_sdate = Date.parse($('#payed_sdate').val()) / 1000;
var payed_edate = Date.parse($('#payed_edate').val()) / 1000;
if (payed_sdate > payed_edate) {
layer.msg('到账开始时间必须小于等于结束时间');
return false;
}
if ((payed_edate - payed_sdate) > 2592000) {
layer.msg('到账时间间隔不能超过31天请重新选择日期');
return false;
}
if (sdate && !edate) {
layer.msg('下单结束时间不能为空');
return false;
}
if (!sdate && edate) {
layer.msg('下单开始时间不能为空');
return false;
}
if (payed_sdate && !payed_edate) {
layer.msg('到账结束时间不能为空');
return false;
}
if (!payed_sdate && payed_edate) {
layer.msg('到账开始时间不能为空');
return false;
}
if (!edate && !sdate && !payed_sdate && !payed_edate) {
layer.msg('时间不能为空');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
$(".select_gallery").select2();
});
</script>
</block>
Loading…
Cancel
Save