支付渠道统计添加权限

master
zhengyongxing 5 years ago
parent 1af6afca3e
commit 80ebdc7f80

@ -1001,11 +1001,12 @@ class FinanceController extends ThinkController
} elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$time = array('elt', (strtotime($_REQUEST['timeend']) + 86399));
}
setPowerPromoteIds($map);
//获取现金充值
$cashStatistics = M('spend', 'tab_')
->field('pay_way,"" as pay_type,SUM(pay_amount) AS pay_amount')
->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time])
->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time,'promote_id'=>$map['promote_id']])
->group('pay_way')
->select();
foreach ($cashStatistics as $key => $value) {
@ -1020,7 +1021,8 @@ class FinanceController extends ThinkController
'tab_deposit.pay_status' => 1,
'tab_deposit.pay_way' => ['gt', 0],
'extend'=>['eq','']
,'tab_deposit.create_time'=>$time
,'tab_deposit.create_time'=>$time,
'tab_deposit.promote_id'=>$map['promote_id']
])->field('tab_deposit.pay_way,"" as pay_type, SUM(tab_deposit.pay_amount) AS balance')
->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number")
->group('tab_deposit.pay_way')
@ -1059,7 +1061,8 @@ class FinanceController extends ThinkController
->where([
'pay_status' => 1,
'pay_way' => ['gt', 0],
'create_time'=>$time
'create_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();
@ -1084,7 +1087,8 @@ class FinanceController extends ThinkController
->field("pay_way,'' as pay_type,sum(real_amount) as pay_amount")
->where([
'order_status'=>['egt',1],
'pay_way'=>['egt',1],'pay_time'=>$time
'pay_way'=>['egt',1],'pay_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();
@ -1114,7 +1118,8 @@ class FinanceController extends ThinkController
'pay_status'=>1,
'pay_way'=>['egt',1],
'pay_source'=>0,
'create_time'=>$time
'create_time'=>$time,
'promote_id'=>$map['promote_id']
])
->group('pay_way')
->select();

@ -50,6 +50,9 @@ class PayChannelController extends ThinkController
$map['pay_status'] = $coinMap['pay_status'] = 1;
$map['pay_way'] = array('egt',1);
setPowerPromoteIds($map,'promote_id');
//游戏币计算
$data = M('spend','tab_')
->field("game_name,sum(pay_amount) as pay_amount,game_id")
@ -61,6 +64,8 @@ class PayChannelController extends ThinkController
//平台币充值金额计算
$coinMap['pay_source'] = 2;
$coinMap['extend'] = array('eq','');
setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
->field("tab_pay_info.game_name,0 as pay_amount,sum(tab_deposit.pay_amount) as platform_coin,0 as test_coin,tab_pay_info.game_id")
@ -118,15 +123,16 @@ class PayChannelController extends ThinkController
$data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0;
}
$superMap = $map;
unset($superMap['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("0 as game_name,sum(pay_price) as pay_amount,0 as platform_coin,0 as test_coin")
->where($map)
->where($superMap)
->find();
$testSuperSignCost = M('game_supersign','tab_')
->join("inner join tab_test_white_list on tab_game_supersign.user_id=tab_test_white_list.user_id")
->where($map)
->where($superMap)
->sum('pay_price');
$superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0;
$superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0;
@ -137,6 +143,7 @@ class PayChannelController extends ThinkController
$offcialmap['pay_status'] = 1;
$offcialmap['pay_way'] = array('egt',1);
$offcialmap['pay_source'] = 0;
setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("id as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,0 as test_coin")
@ -151,6 +158,7 @@ class PayChannelController extends ThinkController
$bindMap['pay_status'] = 1;
$bindMap['pay_way'] = array('egt',1);
setPowerPromoteIds($bindMap,'promote_id');
$bindRechargeData = M('bind_recharge','tab_')
->field('sum(real_amount) as pay_amount')
@ -165,6 +173,7 @@ class PayChannelController extends ThinkController
$spreadMap['order_status'] = array('egt',1);
$spreadMap['pay_way'] = array('egt',1);
setPowerPromoteIds($spreadMap,'promote_id');
//推广后台
$spreadData = M("coin_pay_order","tab_")
->field("0 as game_name,sum(real_amount) as pay_amount,0 as platform_coin,id as test_coin")
@ -343,11 +352,13 @@ class PayChannelController extends ThinkController
if($map['pay_time']) {
$spreadMap['create_time'] = $map['pay_time'];
}
$spreadMap['promote_id'] = $map['promote_id'];
//推广后台
$spreadDataPay = M("coin_pay_order","tab_")
->field("sum(pay_amount) as pay_amount,pay_way")
->where($spreadMap)
->select(false);
if ($map['pay_time']) {
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
@ -367,6 +378,7 @@ class PayChannelController extends ThinkController
if ($map['pay_time']) {
$bindMap['create_time'] = $map['pay_time'];
}
$bindMap['promote_id'] = $map['promote_id'];
$bindRechargeData = M('bind_recharge','tab_')
->field('sum(real_amount) as pay_amount,pay_way')
@ -439,6 +451,9 @@ class PayChannelController extends ThinkController
$page = $p ? $p : 1; //默认显示第一页数据
setPowerPromoteIds($map,'promote_id');
setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$spendData = M('spend','tab_')
->field("pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,cost,pay_amount,pay_way")
->where($map)
@ -454,6 +469,7 @@ class PayChannelController extends ThinkController
->select(false);
$spreadMap['order_status'] = array('egt',1);
setPowerPromoteIds($spreadMap,'promote_id');
// $spreadMap['pay_way'] = array('egt',1);
$coin_pay_order = M('coin_pay_order','tab_')
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way")
@ -463,6 +479,7 @@ class PayChannelController extends ThinkController
//官网数据
$offcialmap['pay_status'] = 1;
$offcialmap['pay_source'] = 0;
setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way")
@ -478,6 +495,7 @@ class PayChannelController extends ThinkController
unset($map['pay_order_number']);
}
unset($map['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way")
@ -601,8 +619,9 @@ class PayChannelController extends ThinkController
$_REQUEST['game_id']?$map['game_id'] = $_REQUEST['game_id']:false;
$_REQUEST['game_id']?$coinMap['game_id'] = $_REQUEST['game_id']:false;
$map['pay_status'] = 1;
setPowerPromoteIds($map,'promote_id');
setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
// $_REQUEST['model']?$model= $_REQUEST['model']:false;
if ($_REQUEST['model']) {
@ -624,6 +643,7 @@ class PayChannelController extends ThinkController
->select(false);
$spreadMap['order_status'] = array('egt',1);
setPowerPromoteIds($spreadMap,'promote_id');
$coin_pay_order = M('coin_pay_order','tab_')
->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way")
@ -633,6 +653,7 @@ class PayChannelController extends ThinkController
//官网数据
$offcialmap['pay_status'] = 1;
$offcialmap['pay_source'] = 0;
setPowerPromoteIds($offcialmap,'promote_id');
$offcialData = M('deposit','tab_')
->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way")
@ -648,6 +669,7 @@ class PayChannelController extends ThinkController
unset($map['pay_order_number']);
}
unset($map['promote_id']);
//超级签数据
$superSignData = M('game_supersign','tab_')
->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way")
@ -798,7 +820,7 @@ class PayChannelController extends ThinkController
if ($_REQUEST['game_id']) {
$map['game_id'] = $_REQUEST['game_id'];
}
setPowerPromoteIds($map,'promote_id');
$data = M('spend','tab_')
->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status")
->join('inner join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id')
@ -813,6 +835,8 @@ class PayChannelController extends ThinkController
$coinMap = $map;
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
unset($coinMap['promote_id']);
setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
@ -939,6 +963,7 @@ class PayChannelController extends ThinkController
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
}
setPowerPromoteIds($map,'tab_deposit.promote_id');
$data = M('deposit','tab_')
->field("pay_order_number,order_number,user_account,create_time as pay_time,pay_amount as cost,pay_amount,pay_way as pay_type,pay_way")
->join('inner join tab_test_white_list on tab_deposit.user_id=tab_test_white_list.user_id')
@ -1098,6 +1123,7 @@ class PayChannelController extends ThinkController
if ($_REQUEST['game_id']) {
$map['game_id'] = $_REQUEST['game_id'];
}
setPowerPromoteIds($map,'promote_id');
$data = M('spend','tab_')
->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status")
@ -1114,6 +1140,9 @@ class PayChannelController extends ThinkController
$coinMap = $map;
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
unset($coinMap['pay_time']);
unset($coinMap['promote_id']);
setPowerPromoteIds($coinMap,'tab_deposit.promote_id');
$coinData = M('pay_info','tab_')
->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number")
->join("inner join tab_test_white_list on tab_test_white_list.user_id=tab_pay_info.user_id")
@ -1283,6 +1312,7 @@ class PayChannelController extends ThinkController
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
}
setPowerPromoteIds($map,'tab_deposit.promote_id');
$accessNum = M('deposit','tab_')
->field("pay_order_number,order_number,user_account,create_time as pay_time,pay_amount as cost,pay_amount,pay_way as pay_type,pay_way")
@ -1446,5 +1476,17 @@ class PayChannelController extends ThinkController
fputcsv($fp, $sumDataPay);
}
function getGameList() {
if (I('partner_id')) {
$map['partner_id'] = I('partner_id');
}
if (I('sdk_type')) {
$map['sdk_version'] = I('sdk_type');
}
$data = M('game','tab_')->field("id,game_name")->where($map)->select();
$this->ajaxReturn($data,'json');
}
}

@ -101,13 +101,11 @@
<!-- </select>-->
<!-- </div>-->
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" style="width:120px;">
<option value="">请选择游戏</option>
<volist name=":getGameList($_GET['partner_id'])" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq $_GET['game_id']">selected=selected</if>>{$vo.game_name}</option>
</volist>
<select id="game_name" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
</select>
</div>
<div class="input-list">
<input type="text" id="timestart" name="timestart" class="" value="{:I('timestart')}" placeholder="下单开始时间" />
-
@ -280,6 +278,28 @@
});
}
function get_game_list()
{
var game_name = "{:I('game_id')}";
$.ajax({
url:"{:U('PayChannel/getGameList')}",
type:"post",
data:{partner_id:$("#partner_id option:selected").val(), sdk_type:$("#sdk_version1 option:selected").val()},
dataType:'json',
success:function(data){
var str = "<option value=''>请选择游戏</option>";
for (var i in data){
str += "<option value='"+data[i].id+"'"+(game_name && data[i].id == game_name?'selected':'')+">"+data[i].game_name+"</option>"
}
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
}
})
}
get_game_list();
$(function(){
$('#timestart').datetimepicker({

Loading…
Cancel
Save