master
elf 7 months ago
parent 1eb82b6d9c
commit a1a5d487c3

@ -1108,6 +1108,6 @@ function getMarketLevel()
}
function isOutPaySite() {
return $_SERVER['HTTP_HOST'] == 'outermg.jianghuifa.cn';
return false;
}

@ -44,17 +44,6 @@ class AdminController extends Controller {
}
}
$rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME);
$outPayRules = [
'admin/spend/listsmime',
'admin/repair/repairedit',
];
if (in_array($rule, $outPayRules) && !isOutPaySite()) {
die('地址错误');
}
if (isOutPaySite() && !in_array($rule, $outPayRules)) {
redirect(U("Admin/Spend/listsMime"));
die();
}
// 检测系统权限
if(!IS_ROOT){
$access = $this->accessControl();

@ -194,179 +194,6 @@ class SpendController extends ThinkController
$this->display();
}
public function listsMime()
{
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
$payStatus = isset($_REQUEST['pay_real_status']) ? $_REQUEST['pay_real_status'] : 1;
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
if($payStatus > 0){
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
}else{
$map['spend_time'] = array('BETWEEN', array($startTime, $endTime));
}
$map['pay_real_status'] = $payStatus;
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
if (isset($_REQUEST['is_check'])) {
$map['is_check'] = (int)($_REQUEST['is_check']);
}
if (isset($_REQUEST['is_refund'])) {
$map['is_refund'] = (int)($_REQUEST['is_refund']);
}
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']);
}
if (isset($_REQUEST['spend_ip'])) {
$map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%');
unset($_REQUEST['spend_ip']);
}
if (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name'] == '全部') {
unset($_REQUEST['game_name']);
} else {
$map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
unset($_REQUEST['game_name']);
}
}
if (isset($_REQUEST['game_type']) && $_REQUEST['game_type']) {
$map['sdk_version'] = $_REQUEST['game_type'];
}
if (isset($_REQUEST['server_id'])) {
$map['server_id'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
if (isset($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number']));
unset($_REQUEST['pay_order_number']);
}
if (isset($_REQUEST['extend'])) {
$map['extend'] = array('like', trim($_REQUEST['extend']));
unset($_REQUEST['extend']);
}
$map['pay_way'] = ['in', '41'];
if (isset($_REQUEST['pay_game_status'])) {
$map['pay_game_status'] = $_REQUEST['pay_game_status'];
unset($_REQUEST['pay_game_status']);
}
if ($_REQUEST['merchant_id']) {
$map['merchant_id'] = $_REQUEST['merchant_id'];
unset($_REQUEST['merchant_id']);
}
if (isset($_REQUEST['promote_id'])) {
$promoteId = intval($_REQUEST['promote_id']);
if ($promoteId == 0) {
$map['promote_id'] = 0;
} else {
$promoteMap['chain'] = ['like', "%/$promoteId/%"];
$promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
}
$isMarketAdmin = isMarketAdmin();
$isMarketLeader = isMarketLeader();
$marketAdminIds = getSearchAdminIds('market_admin_id');
if (is_array($marketAdminIds)) {
$map['market_admin_id'] = ['in', $marketAdminIds];
}
setPowerPromoteIds($map,'promote_id');
if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
$sort = $data_order == 3 ? 'desc' : 'asc';
$order = $data_order_type . ' ' . $sort;
} else {
$order = ' pay_time desc ';
}
if (I('platform_type', 0) != 0) {
$sy = I('platform_type', 0) == 1 ? '=' : '<>';
$game_id = M("Game","tab_")->where('unique_code ' . $sy . ' ""')->getField("id",true);
$map['game_id'] = ['in',$game_id];
}
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
// $map1 = $map;
// $map1['pay_status'] = 1;
// } else {
// $map = '1 = 2';
// $map1 = $map;
// }
$this->checkListOrCountAuthRestMap($map,["extend", "pay_order_number", "user_account"]);
D("Spend")->addSubsiteWhere($map);
if ($payStatus > 0) {
$map1 = $map;
$map1['pay_status'] = 1;
$total = null_to_0(M(self::model_name, "tab_")->where($map1)->sum('pay_amount'));
}
$total=$total?$total:0;
$this->assign('total', $total);
$this->meta_title = $this->m_title = '游戏充值';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
// dd($data);
if (!empty($data['data'])) {
$adminIds = array_column($data['data'], 'market_admin_id');
$adminUsernameList = getAdminUsernameList($adminIds);
$adminDepartments = getAdminDepartmentList($adminIds);
foreach ($data['data'] as $key=>&$value) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无';
$value['admin_department'] = $adminDepartments[$value['market_admin_id']] ?? '无';
$value['is_check_str'] = D(self::model_name)::IsCheckStr[$value['is_check']];
$value['is_refund_str'] = D(self::model_name)::IsRefundStr[$value['is_refund']];
//拆分游戏名称和设备类型
$game_arr = explode("(", rtrim($value['game_name'], ")"));
$value['game_name'] = $game_arr[0];
$value['sdk_version_name'] = $game_arr[1];
if(!$value['pay_time']) $value['pay_time'] = $value['spend_time'];
}
}
$departments = M('department', 'sys_')->select();
$this->assign('departments', $departments);
$this->assign('isMarketLeader', $isMarketLeader);
$this->assign('showMarketAdmin', session('user_auth')['show_market_admin']);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('isMarketAdmin', $isMarketAdmin);
$this->assign('marketAdmins', getMarketAdmins());
$this->assign('startDate', $startDate);
$this->assign('endDate', $endDate);
$this->assign('payStatus', $payStatus);
$this->assign('list_data', $data['data']);
$this->assign('_page', $data['page']);
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
$this->assign('show_data_power', $show_data_power);
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$this->assign('menubtn',$this->menuAuth());
$this->display();
}
protected function menuAuth()
{
$mentBtn = [

@ -1,881 +0,0 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
tr td:nth-child(3){
max-width: 200px;
word-wrap:break-word;
line-height: 1.5;
padding:5px;
}
.search_list{
margin-bottom: 15px;
}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
.data_list table td{
line-height: 2;
}
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">游戏充值</h3>
<p class="description_text">说明游戏充值全部订单全部订单包含游戏SDK内所有支付的订单包含SDK现金支付、平台币支付、绑币支付</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" name="{$model['search_key']|default='user_account'}" placeholder="玩家账号" class=""
value="{:I('user_account')}">
</div>
<div class="input-list">
<input type="text" name="pay_order_number" class="" value="{:I('pay_order_number')}" placeholder="支付订单号">
</div>
<div class="input-list">
<input type="text" name="extend" class="" value="{:I('extend')}" placeholder="CP订单号">
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="充值开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time-end" name="timeend" class="" value="{$endDate}"
placeholder="充值结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type" name="game_type" class="select_gallery" >
<option value="">设备类型</option>
<option value="1" <?php echo I('game_type') == 1 ? "selected" : ''?>>安卓</option>
<option value="2" <?php echo I('game_type') == 2 ? "selected" : ''?>>苹果</option>
</select>
</div>
<div class="input-list input-list-server search_label_rehab">
<select id="server_id" name="server_id" class="select_gallery" style="width:120px;">
<option value="">区服名称</option>
</select>
</div>
<div class="input-list search_item input-list-orderstatus">
<select name="pay_real_status" style="color:#444" class="select_gallery" id="sel_order">
<!-- <option value="">订单状态</option> -->
<option value="1" <?php echo $payStatus == 1 ? "selected" : ''?>>充值成功</option>
<option value="0" <?php echo $payStatus == 0 ? "selected" : ''?>>下单未付款</option>
</select>
</div>
<div class="input-list">
<input type="text" name="spend_ip" class="" value="{:I('spend_ip')}" placeholder="充值ip">
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="pay_game_status" style="color:#444" class="select_gallery" id="pay_game_status">
<option value="">游戏通知状态</option>
<option value="1">通知成功</option>
<option value="0">通知失败</option>
<option value="2">已退款</option>
</select>
</div>
<br>
<?php if($showPromote == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_level" style="color:#444" class="select_gallery" id="promote_level">
<option value="">请选择推广员等级</option>
<option value="1" <?php if ($_POST['promote_level'] == 1):?>selected<?php endif;?>>会长</option>
<option value="2" <?php if ($_POST['promote_level'] == 2):?>selected<?php endif;?>>部门长</option>
<option value="3" <?php if ($_POST['promote_level'] == 3):?>selected<?php endif;?>>组长</option>
<option value="4" <?php if ($_POST['promote_level'] == 4):?>selected<?php endif;?>>组员</option>
</select>
-
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="promote_id" style="color:#444" class="select_gallery" id="promote_id">
<option value="">请选择推广员</option>
</select>
</div>
<?php endif;?>
<?php if(!$isMarketAdmin && !$isMarketLeader):?>
<div class="input-list input-list-server search_label_rehab">
<select id="department_id" name="department_id" class="select_gallery" style="width:120px;">
<option value="">请选择市场部</option>
<?php foreach($departments as $department):?>
<option value="<?=$department['id']?>" <?php if($department['id'] == I('department_id')):?>selected<?php endif;?>><?=$department['name']?></option>
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<?php if(!$isMarketAdmin && $showMarketAdmin == 1):?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="market_admin_id" style="color:#444" class="select_gallery" id="market_admin_id">
<option value="0">所属市场专员</option>
<?php foreach($marketAdmins as $marketAdmin):?>
<option value="<?=$marketAdmin['id']?>" <?php if ($_POST['market_admin_id'] == $marketAdmin['id']):?>selected<?php endif;?>><?=$marketAdmin['username']?></option>
<?php endforeach;?>
</select>
</div>
<?php endif;?>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="platform_type" style="color:#444" class="select_gallery" id="platform_type">
<option value="0">游戏平台</option>
<option value="1">联运平台</option>
<option value="2">聚合平台</option>
</select>
</div>
<if condition="!IS_SUBSITE">
<div class="input-list search_item input-list-gamenoticestatus">
<select id="merchant_id" name="merchant_id" class="select_gallery">
<option value="0">请选择商户</option>
<volist name=":getMerchantList()" id="vo">
<option value="{$vo.id}" <if condition="$_GET['merchant_id'] eq $vo['id']">selected</if>>{$vo.name}</option>
</volist>
</select>
</div>
</if>
<div class="input-list search_item input-list-gamenoticestatus">
<select id="is_check" name="is_check" class="select_gallery">
<option value="">是否参与结算</option>
<option value="1"></option>
<option value="2"></option>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select id="is_refund" name="is_refund" class="select_gallery">
<option value="">退款状态</option>
<option value="1">已退款</option>
<option value="0">--</option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('Spend/listsMime','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- <div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<foreach name="menubtn" item="vo" >
{$vo}
</foreach>
</div>
</div> -->
<!-- 数据列表 -->
<div class="data_list zdata_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>支付订单号</th>
<th style="max-width: 100px;">CP订单号</th>
<th><a class="paixu" data-order='pay_time'>
充值时间
</a></th>
<th>支付时间</th>
<th>玩家账号</th>
<th>游戏名称</th>
<th>设备类型</th>
<?php if($showPromote == 1):?>
<th>所属推广员</th>
<?php endif;?>
<th>所属市场部</th>
<?php if($showMarketAdmin == 1):?>
<th>所属市场专员</th>
<?php endif;?>
<th>所属商户</th>
<th>充值ip</th>
<th>区服ID</th>
<th>游戏区服</th>
<th>角色ID</th>
<th>角色名称</th>
<th>订单金额</th>
<th>折扣</th>
<th><a class="paixu" data-order='pay_amount'>
实付金额
</a></th>
<th>充值方式</th>
<th>订单状态</th>
<th>退款状态</th>
<th>游戏通知状态</th>
<th>是否参与结算</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="22" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<td ><input class="ids" type="checkbox" data-ischeck="{$data.is_check}" data-isrefund="{$data.is_refund}" value="{$data['id']}" name="ids[]"></td>
<td>
<if condition="$show_data_power eq true ">
{$data.pay_order_number}
<else />
{$data.pay_order_number|encryptStr}
</if>
</td>
<td>
<if condition="$show_data_power eq true ">
{$data.extend}
<else />
{$data.extend|encryptStr}
</if>
</td>
<td>{:set_show_time($data['pay_time'])}</td>
<td>
<if condition="$data['pay_real_status'] eq 1">
{:set_show_time($data['payed_time'])}
<else />
------
</if>
</td>
<td>
<if condition="$show_data_power eq true ">
{$data.user_account}
<else />
{$data.user_account|encryptStr}
</if>
<gt name="data.small_id" value="0"><neq name="data.small_id" value="$data.user_id">{$data.small_account}</neq></gt></td>
<td>{$data.game_name}</td>
<td>{$data.sdk_version_name}</td>
<?php if($showPromote == 1):?>
<td>
<eq name="data.promote_id" value="-1">C('OFFICIEL_CHANNEL')<else/>
<!-- <if condition="$is_admin eq true ">
{:get_promote_account($data['promote_id'])}
<else />
{:encryptStr(get_promote_account($data['promote_id']))}
</if>-->
{$data['promote_account']}
<!-- {:get_promote_account($data['promote_id'])}-->
</eq>
</td>
<?php endif;?>
<td >{$data.admin_department}</td>
<?php if($showMarketAdmin == 1):?>
<td >{$data.market_admin_username}</td>
<?php endif;?>
<td >{:getMerchantName($data['merchant_id'])}</td>
<td>{$data.spend_ip}</td>
<empty name='data.server_name'>
<td>— —</td>
<td>— —</td>
<else/>
<td>{$data.server_id}</td>
<td>{$data.server_name}</td>
</empty>
<empty name='data.game_player_name'>
<td>— —</td>
<td>— —</td>
<else/>
<td>{$data.game_player_id}</td>
<td>{$data.game_player_name}</td>
</empty>
<td>{$data.cost|default=0.00}</td>
<td>{$data.discount_amount|default=0.00}</td>
<td><span>{$data.pay_amount}</span></td>
<td>{:get_pay_way($data['pay_way'])}</td>
<td>
<if condition="$data['pay_real_status'] eq 1"><span class="order_status_color">{:get_info_status($data['pay_real_status'],9)}</span>
<else/>
{:get_info_status($data['pay_real_status'],9)}
</if>
</td>
<td>{$data.is_refund_str}</td>
<td>
<if condition="$data['pay_real_status'] eq 1"><span class="game_notice_status_color">{:get_info_status($data['pay_game_status'],14)}</span>
<elseif condition="$data.pay_real_status eq 0"/>
— —
<else/>
{:get_info_status($data['pay_game_status'],14)}
</if>
</td>
<td>{$data.is_check_str}</td>
<td style="text-indent:0;">
<?php
if (!(substr($data['pay_order_number'], 0, 3) == "PF_" &&
substr($data['pay_order_number'], -2) == '_1')) {
?>
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and $data['pay_real_status'] eq 1 and $data['is_refund'] eq 0">
<a class=" budan" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/repairEdit')}" style="width:100%;">补单</a>
</if>
<?php }?>
<br />
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and ($data['pay_real_status'] eq 0 or $data['pay_real_status'] eq 2) and $data['is_refund'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
</td>
</tr>
</volist>
</empty>
<if condition="$rule_count_check">
<tr class="data_summary">
<td colspan="2">汇总</td>
<td colspan="99">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_real_status','',$list_data),'pay_amount')))}
累计充值:{$total}(此处只汇总充值成功的订单)
</td>
</tr>
</if>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>71,'xlsname'=>'游戏订单_游戏充值','timestart'=>$startDate,'timeend'=>$endDate),I('get.')))}">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Spend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Spend/lists')}');
$(function () {
//搜索功能
$("#search").click(function () {
var sdate = Date.parse($('#time-start').val()) / 1000;
var edate = Date.parse($('#time-end').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('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;
});
$(".paixu").click(function () {
var that = $(this);
$data_order = that.attr('data-order');
$order_type = '{$userarpu_order}';
if ($order_type == '' || $order_type == '4') {
$(".sortBy").attr('name', 'data_order');
val = '3,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
} else if ($order_type == '3') {
$(".sortBy").attr('name', 'data_order');
val = '4,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$(".budan").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
$(".budan2").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
$.ajax({
type: 'post',
url: url,
data: {orderNo: data},
success: function (e) {
if (e.status == 1) {
if (e.msg.length > 30) {
window.open(e.msg);
} else {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
}
} else {
layer.msg(e.msg, {icon: 2});
}
},
});
});
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'spend'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down11 .nav-list li").find("a").each(function () {
var that = $(".drop-down11");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down12").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down12 .nav-list li").find("a").each(function () {
var that = $(".drop-down12");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down13").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down13 .nav-list li").find("a").each(function () {
var that = $(".drop-down13");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
//下拉内容框
$(".drop-down2").on('click', function (event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function () {
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#i_list_id').on('keyup', function (event) {
var val = $.trim($(this).val()).toLowerCase();
$('#i_list_idh').val(val);
});
$("#i_list_li").find("a").each(function () {
$(this).click(function () {
var text = $.trim($(this).text()).toLowerCase();
$("#i_list_id").val(text);
$('#i_list_idh').val(text);
})
});
var adminId = "{:I('market_admin_id')}";
var departmentId = "{:I('department_id')}";
function getAdminsByDepartmentId() {
var departmentId = $("#department_id option:selected").val();
if(!departmentId){
departmentId = -1;
}
$.ajax({
url: "{:U('Ajax/getAdminsByDepartment')}",
type: "get",
data: { department_id: departmentId},
dataType: 'json',
success: function (response) {
str = '<option value="">请选择市场专员</option>';
admins = response.data.admins;
for (var i in admins) {
str += "<option value='" + admins[i].uid + "' " + (adminId && admins[i].uid == adminId ? 'selected' : '') + ">" + admins[i].nickname + "</option>"
}
$("#market_admin_id").empty();
$("#market_admin_id").append(str);
$("#market_admin_id").select2();
}
})
}
getAdminsByDepartmentId();
$("#market_admin_id").change(function(){
adminId = $("#admin_id option:selected").val();
})
$("#department_id").change(function(){
getAdminsByDepartmentId();
})
})
var promote_id = "{:I('promote_id')}";
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevelOther')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
var game_server = "{:I('server_id')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(game_server && data[i].server_id == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
$("#addStatement,#removeStatement").on("click",function(){
var id = $(this).attr("id");
if(id == "addStatement"){
var opname = "参与结算";
var opurl = "{:U('addStatement')}";
var opst ="[不参与结算]";
var status = [2];
}else if(id=="removeStatement"){
var opname = "移出结算";
var opurl = "{:U('removeStatement')}";
var opst ="[参与结算]";
var status = [1];
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
const ischeck = $(elem).data("ischeck");
if($.inArray(ischeck,status) > -1){
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的操作,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
text = text.join(",");
layer.confirm('【提示】'+opname+'操作后,相应的结算单需要进行重算后生效', {
btn: ['确认','取消'],
title:false
}, function(index){
layer.close(index);
layer.load(2);
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: {ids:text},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
$("#addRefund,#removeRefund").on("click",function(){
var id = $(this).attr("id");
if(id == "addRefund"){
var opname = "登记退款";
var opurl = "{:U('addRefund')}";
var opst ="[未退款]";
var status = [0];
}else if(id=="removeRefund"){
var opname = "取消退款";
var opurl = "{:U('removeRefund')}";
var opst ="[已退款]";
var status = [1];
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
const isrefund = $(elem).data("isrefund");
if($.inArray(isrefund,status) > -1){
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的操作,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
text = text.join(",");
layer.confirm('【提示】'+opname+'退款功能仅用于登记相关数据,未引入结算', {
btn: ['确认','取消'],
title:false
}, function(index){
layer.close(index);
layer.load(2);
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: {ids:text},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
});
</script>
</block>

@ -1423,5 +1423,5 @@ function is_active_class(array $controllers, array $actions, \Closure $otherCond
function isOutPaySite() {
return $_SERVER['HTTP_HOST'] == 'outertg.jianghuifa.cn';
return false;
}

@ -33,25 +33,6 @@ class BaseController extends HomeController
$loginer = $this->getLoginPromote();
$url = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME);
if (!in_array($url, [
'home/query/getsubpromotes'
])) {
$outPayRules = [
'home/query/rechargemine',
'home/download/recharge_data_export_new',
'home/download/listsindexnew',
'home/download/export',
];
if (in_array($url, $outPayRules) && !isOutPaySite()) {
die('地址错误');
}
if (isOutPaySite() && !in_array($url, $outPayRules)) {
$this->redirect('Query/rechargeMine');
die();
}
}
$this->accessLimit($loginer);
// $this->certifiCation();

@ -180,103 +180,7 @@ class DownloadController extends BaseController
$this->assign('promoteNameArr', $promoteNameArr);
return $this->display();
}
public function listsIndexNew($p = 0)
{
$nowTime = date('Y-m-d');
$initBegTime = empty(I('begtime')) ? '' : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? '' : I('endtime');
$this->assign('begtime', $initBegTime);
$this->assign('endtime', $initEndTime);
$map1['chain'] = ['like', '%' . '/' . PID . '/' . '%'];
$res = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if (empty($res)) {
$map['tab_downloadlog.promote_id'] = PID;
} else {
foreach ($res as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id . ',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_downloadlog.promote_id'] = ['in', $childPromoteIds];
}
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$childPromoteIds = M('promote', 'tab_')->where($map2)->getField('id', true);
$map = [];
if (count($childPromoteIds) > 0) {
$map = ['promote_id' => ['in', $childPromoteIds]];
} else {
$map['_string'] = '1<>1';
}
if (!empty($_REQUEST['dataname'])) {
$map['dataname'] = ['like', '%' . $_REQUEST['dataname'] . '%'];
}
if (!empty($_REQUEST['logid'])) {
$map['logid'] = $_REQUEST['logid'];
}
if (!empty($_REQUEST['begtime']) && !empty($_REQUEST['endtime'])) {
if (strtotime($_REQUEST['begtime']) == strtotime($_REQUEST['endtime'])) {
$endtime = strtotime($_REQUEST['endtime']) + 24 * 60 * 60;
} else {
$endtime = strtotime($_REQUEST['endtime']);
}
$map['addtime'] = array('BETWEEN', array(strtotime($_REQUEST['begtime']), $endtime));
}
$map['type'] = '/Home/Query/rechargeMine';
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = 10;
$rs = M('downloadlog', 'tab_')->where($map)->order('tab_downloadlog.addtime desc')
->page($page, $row)->select();
foreach ($rs as $key => $value) {
$pid = intval($value['promote_id']);
$getNameRs = M('promote', 'tab_')->field("real_name")->where(['id' => $pid])->find();
$rs[$key]['actor'] = $getNameRs['real_name'];
}
$promoteArr = explode(',', $childPromoteIds);
$promoteNameArr = [];
foreach ($promoteArr as $key1 => $value1) {
$promoteName = M('promote', 'tab_')->field("real_name")->where(['id' => intval($value1)])->find();
$promoteNameArr[$key1]['name'] = $promoteName['real_name'];
$promoteNameArr[$key1]['promote_id'] = $value1;
}
/* 查询记录总数 */
$count = M("downloadlog", "tab_")
->field('tab_downloadlog.id')
->where($map)
->select();
$count = count($count);
//分页
$parameter['p'] = I('get.p', 1);
$parameter['row'] = I('get.row');
$parameter['dataname'] = $_REQUEST['dataname'];
$parameter['logid'] = $_REQUEST['logid'];
$parameter['begtime'] = I('begtime');
$parameter['endtime'] = I('endtime');
$parameter['level_promote_2'] = $levelPromote[0];
$parameter['level_promote_3'] = $levelPromote[1];
$parameter['level_promote_4'] = $levelPromote[2];
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('data', $rs);
$this->assign('promoteNameArr', $promoteNameArr);
return $this->display();
}
}
/**
* IOS详细下载数统计
@ -1603,134 +1507,6 @@ class DownloadController extends BaseController
$this->success('添加下载成功,导出数据不包含当天', U('listsIndex'));
}
/**
* 充值明细添加下载
* @author sunke
*/
public function recharge_data_export_new()
{
// 支付到账时间
$payedBegTime = I("payed_begtime", '');
if ($payedBegTime) {
$payedBegTime = strtotime($payedBegTime);
$payedEndTime = I("payed_endtime", '');
if ($payedEndTime) {
$payedEndTime = strtotime($payedEndTime) + 86400;
}
}
if ($payedBegTime && !$payedEndTime) {
$this->error('到账时间有误,请检查。');
}
if (($payedEndTime - $payedBegTime) > 31 * 24 * 3600) {
$this->error('到账时间范围不能超过31天');
}
// 下单时间
$beginTime = strtotime(I('begtime') . ' 00:00:00');
$endtime = strtotime(I('endtime') . ' 23:59:59');
if (($endtime - $beginTime) > 31 * 24 * 3600) {
$this->error('下单时间范围不能超过31天');
}
$map1['chain'] = ['like', '%' . '/' . PID . '/' . '%'];
$rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select();
$childPromoteIds = '';
if (empty($rs)) {
$map['tab_spend.promote_id'] = PID;
} else {
foreach ($rs as $rsKey => $rsValue) {
$id = $rsValue['id'];
$childPromoteIds .= $id . ',';
}
$childPromoteIds = rtrim($childPromoteIds, ',');
$childPromoteIds .= ',' . PID;
$map['tab_spend.promote_id'] = ['in', $childPromoteIds];
}
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$map2[] = [
'_logic' => 'or',
'id' => $queryPromote['id'],
'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']
];
$ids = M('promote', 'tab_')->where($map2)->getField('id', true);
if (empty($ids)) {
$ids = array();
}
if (empty($levelPromote)) {
array_push($ids, PID);
}
array_push($ids, $queryPromote['id']);
if (!empty($ids)) {
$map['tab_spend.promote_id'] = ['in', $ids];
} 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.spend_time'] = ['egt', strtotime(I('begtime'))];
} elseif (empty(I('begtime')) && !empty(I('endtime'))) {
$map['tab_spend.spend_time'] = ['elt', strtotime(I('endtime')) + 86399];
} elseif (!empty(I('begtime')) && !empty(I('endtime'))) {
$map['tab_spend.spend_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]];
} else {
// $nowTime = date('Y-m-d');
// $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
// $initEndTime = date('Y-m-d');
// $initBegTime = strtotime($initBegTime);
// $initEndTime = strtotime($initEndTime);
// $map['tab_spend.spend_time'] = ['between',[$initBegTime,$initEndTime]];
}
if ($payedBegTime) {
$map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]];
}
empty(I('relation_game_id')) || $map['tab_game.relation_game_id'] = I('relation_game_id');
empty(I('sdk_version')) || $map['tab_game.sdk_version'] = I('sdk_version');
empty(I('server_id')) || $map['tab_spend.server_id'] = I('server_id');
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'] = ['like', '%' . I('user_account') . '%'];
empty(I('pay_order_number')) || $map['tab_spend.pay_order_number'] = I('pay_order_number');
if (isset($_REQUEST['pay_real_status']) && $_REQUEST['pay_real_status'] !== '') {
$payStatus = intval(I('pay_real_status'));
if (in_array($payStatus, array_keys(self::$payStatus))) {
$map['tab_spend.pay_real_status'] = $payStatus + 2;
}
}
$map['tab_spend.pay_way'] = 41;
$map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check');
$conditions = json_encode($map, true);
$addtime = time();
$data = [
'logid' => 'cz_' . time(),
'promote_id' => PID,
'type' => '/Home/Query/rechargeMine',
'dataname' => '充值明细数据(新)',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' => $conditions
];
$res = M('downloadlog', 'tab_')->add($data);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功,导出数据不包含当天', U('listsIndexNew'));
}
public function userRecharge_data_export()
{
$gameId = I('relation_game_id', 0);

@ -269,223 +269,6 @@ 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_real_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--';
$list['pay_status'] = isset(QueryController::$payStatus[$list['pay_real_status']]) ? QueryController::$payStatus[$list['pay_real_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_real_status']) || $parameter['pay_real_status'] = I('pay_real_Zstatus', -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));

@ -36,16 +36,6 @@
<img src="{$siteConfig['logo']}" style="height:40px;margin:0px;">
</div>
<?php if(isOutPaySite()) { ?>
<div class="subNavBox">
<div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Query/rechargeMine')}" class="<?=is_active_class(['Query'], ['rechargeMine'])?>">充值明细</a>
</div>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>安全管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Download/listsIndexNew')}" class="<?=is_active_class(['Download'], ['listsIndexNew'])?>">下载日志管理</a>
</div>
</div>
<?php } else { ?>
<div class="subNavBox">
<a href="{:U('Promote/index')}" class="subNav <?=is_active_class(['Promote'], ['index'])?>"> 后台首页 </a>

@ -1,472 +0,0 @@
<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/rechargeMine','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_new',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