新增子站游戏订单及导出

master
chenzhi 4 years ago
parent 8b98460242
commit bb10181cc5

@ -1087,6 +1087,12 @@ class ExportController extends Controller
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
$is_sub_data = I("issubdata",0);
if($is_sub_data == 1){
$SpendModel = M("spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("spend","tab_");
}
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
@ -1201,7 +1207,7 @@ class ExportController extends Controller
D("Spend")->addSubsiteWhere($map);
$map1 = $map;
$map1['pay_status'] = 1;
$total = M('Spend','tab_')->where($map1)->sum('pay_amount');
$total = $SpendModel->where($map1)->sum('pay_amount');
// var_dump($total);die();
$total=$total?$total:0;
@ -1277,7 +1283,7 @@ class ExportController extends Controller
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = M('Spend',"tab_")
$accessNum = $SpendModel
->where($map)
->count();
@ -1286,7 +1292,7 @@ class ExportController extends Controller
// var_dump($count);die();
for($i = 1; $i <= $pages; $i++) {
$xlsData = M('Spend',"tab_")
$xlsData = $SpendModel
->field($fields)
->where($map)
->limit(($i-1)*$perSize ,$perSize)

@ -0,0 +1,288 @@
<?php
namespace Admin\Controller;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class SubSpendController extends ThinkController
{
const model_name = 'Spend';
public $OpAuthList;
public function lists()
{
list($is_sub_data, $startTime, $endTime) = $this->setSelectDate();
// dump($is_sub_data);
// dump($startTime);
// dump($endTime);
// dd(1);
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
if (isset($_REQUEST['is_check'])) {
$map['is_check'] = (int)($_REQUEST['is_check']);
}
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']);
}
if (isset($_REQUEST['pay_status'])) {
$map['pay_status'] = $_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
if (isset($_REQUEST['pay_way'])) {
if ($_REQUEST['pay_way'] == 2) {
$map['pay_way'] = ['in', '2,3,4'];
} else {
$map['pay_way'] = $_REQUEST['pay_way'];
}
unset($_REQUEST['pay_way']);
}
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']);
}
$marketAdminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$marketAdminId = $userAuth['uid'];
} else {
$marketAdminId = I('market_admin_id', 0);
}
if ($marketAdminId > 0) {
$map['market_admin_id'] = $marketAdminId;
} else {
setPowerPromoteIds($map,'promote_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];
}
}
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);
$map1 = $map;
$map1['pay_status'] = 1;
$total = null_to_0(M(self::model_name,"tab_")->where($map1)->sum('pay_amount'));
$this->assign('total', $total);
$this->meta_title = $this->m_title = '游戏充值';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
$data = $this->getSpendList($_GET["p"], $map, $order,$is_sub_data);
if (!empty($data['data'])) {
$adminUsernameList = getAdminUsernameList(array_column($data['data'], 'market_admin_id'));
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['is_check_str'] = D(self::model_name)::IsCheckStr[$value['is_check']];
//拆分游戏名称和设备类型
$game_arr = explode("(", rtrim($value['game_name'], ")"));
$value['game_name'] = $game_arr[0];
$value['sdk_version_name'] = $game_arr[1];
}
}
$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('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 = [
"addStatement"=>"<a class='butn' id='addStatement'>参与结算</a>",
"removeStatement"=>"<a class='butn' id='removeStatement' style='background-color: red;'>移出结算</a>",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
if(IS_ROOT){
$resarr[] = $v;
}else{
if(in_array($k,$this->OpAuthList)){
$resarr[] = $v;
}
}
}
return $resarr;
}
public function addStatement()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIscheck($ids,2,1);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
public function removeStatement()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIscheck($ids,1,2);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
protected function editOrderIscheck($ids,$oldval,$newval){
$dbres = D(self::model_name)->where("id in ({$ids}) and is_check = '{$oldval}'")->select();
if(empty($dbres)) return false;
$changeIds = implode(",",array_column($dbres,"id"));
//执行操作
$res = D(self::model_name)->where("id in ({$changeIds}) and is_check = '{$oldval}'")->save(['is_check'=>$newval]);
if(empty($res)) return false;
//日志
if($newval == 1){
$op_name = "加入结算";
$key = "addStatement";
}else{
$op_name = "移出结算";
$key = "removeStatement";
}
addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,"content"=>json_encode(["ids"=>$_REQUEST['ids'],"is_check"=>$newval])]);
return true;
}
protected function setSelectDate()
{
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$is_sub_data = false;
$lastSynTime = M("Kv","sub_",SUBSITE_DB)->where("`key` = 'sub_spend_syn_time'")->getField("value");
if($lastSynTime >= $startTime && $lastSynTime < $endTime){
$this->redirect(ACTION_NAME, array('timestart' => $startDate,"timeend"=>date('Y-m-d',$lastSynTime)));
}
if($lastSynTime >= $startTime && $lastSynTime <= $endTime){
$is_sub_data = true;
$endTime = $lastSynTime;
}
if($lastSynTime > $endTime){
$is_sub_data = true;
}
$this->assign('startDate', date('Y-m-d',$startTime));
$this->assign('endDate', date('Y-m-d',$endTime));
$this->assign('isSubData', $is_sub_data ? 1 : 0);
$this->assign('lastSynTime', date('Y-m-d',$lastSynTime));
return [$is_sub_data,$startTime,$endTime];
}
protected function getSpendList($p = 1, $map = array(), $order, $is_sub_data)
{
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
if($is_sub_data){
$SpendModel = M("spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("spend","tab_");
}
$list = $SpendModel
->where($map)
->page($page, $row)
->order($order ? $order : 'pay_time desc')
->select();
$count = $SpendModel->where($map)->count();
if($count < 20000){
$page = set_pagination_all($count, $row);
}else{
$page = set_pagination($count, $row);
}
$data['data'] = $list;
if ($page) {
$data['page'] = $page;
}
return $data;
}
}

@ -0,0 +1,786 @@
<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内所有支付的订单 / 最后固定数据时间:【{$lastSynTime}】</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 input-list-spend search_label_rehab">
<select id="pay_way_id" name="pay_way" class="select_gallery" style="width:120px;">
<option value="">充值方式</option>
<volist name=":all_pay_way_other(1)" id="vo">
<option value="{$vo.key}">{$vo.value}</option>
</volist>
</select>
</div>
<div class="input-list search_item input-list-orderstatus">
<select name="pay_status" style="color:#444" class="select_gallery" id="sel_order">
<option value="">订单状态</option>
<option value="1">充值成功</option>
<option value="0">下单未付款</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 && $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>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('lists','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;?>
<?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><a class="paixu" data-order='pay_amount'>
实付金额
</a></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}" 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_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;?>
<?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><span>{$data.pay_amount}</span></td>
<td>{:get_pay_way($data['pay_way'])}</td>
<td>
<if condition="$data['pay_status'] eq 1"><span class="order_status_color">{:get_info_status($data['pay_status'],9)}</span>
<else/>
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<td>
<if condition="$data['pay_status'] eq 1"><span class="game_notice_status_color">{:get_info_status($data['pay_game_status'],14)}</span>
<elseif condition="$data.pay_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_status'] eq 1">
<a class=" budan" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/repairEdit')}" style="width:100%;">补单</a>
<else/>
<span>补单</span>
</if>
<?php }?>
<br />
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and ($data['pay_status'] eq 0 or $data['pay_status'] eq 2)">
<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="21">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_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'=>7,'xlsname'=>'游戏订单_游戏充值','timestart'=>$startDate,'timeend'=>$endDate,'issubdata'=>$isSubData),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('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 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;
}
}
});
});
})
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
});
</script>
</block>
Loading…
Cancel
Save