Merge branch 'release' of wmtx/platform into master

热修更新
master
廖金灵 5 years ago committed by Gogs
commit b27c2c46a5

@ -2409,35 +2409,35 @@ class ExportController extends Controller
// }
if(isset($params['server_type'])) {
$map['tab_test_order.server_type'] = $params['server_type'];
$map['t.server_type'] = $params['server_type'];
}
if(isset($params['order_type'])) {
$map['tab_test_order.order_type'] = $params['order_type'];
$map['t.order_type'] = $params['order_type'];
}
if(isset($params['order_no'])) {
$map['tab_test_order.order_no'] = $params['order_no'];
$map['t.order_no'] = $params['order_no'];
}
if(isset($params['user_account'])) {
$map['tab_test_order.user_account'] = $params['user_account'];
$map['t.user_account'] = $params['user_account'];
}
if(isset($params['pay_way'])) {
$map['tab_test_order.pay_way'] = $params['pay_way'];
$map['t.pay_way'] = $params['pay_way'];
}
if(!empty($params['timestart']) && !empty($params['timeend'])){
$timestart = strtotime($params['timestart']);
$timeend = strtotime($params['timeend'])+86399;
$map['tab_test_order.pay_time'] = array("between",array($timestart,$timeend));
$map['t.pay_time'] = array("between",array($timestart,$timeend));
}else if(!empty($params['timestart']) && empty($params['timeend'])) {
$timestart = strtotime($params['timestart']);
$map['tab_test_order.pay_time'] = array("EGT",$timestart);
$map['t.pay_time'] = array("EGT",$timestart);
}else if (!empty($params['timeend']) && empty($params['timestart'])) {
$timeend = strtotime($params['timeend'])+86399;
$map['tab_test_order.pay_time'] = array("ELT",$timeend);
$map['t.pay_time'] = array("ELT",$timeend);
}
@ -2445,8 +2445,8 @@ class ExportController extends Controller
->field("t.*,g.sdk_version")
->join("tab_game g on t.game_id = g.id","left")
->where($map)->order('add_time desc')->select();
$sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
$sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
$sum_order_amount = M('test_order', 'tab_')->alias("t")->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
$sum_pay_amount = M('test_order', 'tab_')->alias("t")->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
$xlsData = [];
foreach($orderData as $k => $v) {
if ($v['server_type'] == 1) {

@ -402,6 +402,7 @@ class PayChannelController extends ThinkController
$this->assign('channelData2',$channelData);
$this->assign('sum_platform_pay_amount',$sum_platform_pay_amount);
$this->assign('sum_noplatform_pay_amount',$sum_noplatform_pay_amount);
$this->assign('sum_pay_amount',$sum_pay_amount);
$moneyAllCount = array_sum(array_column($channelData, 'pay_amount'));
$this->assign('moneyAllCount',$moneyAllCount);
$this->display();
@ -988,10 +989,15 @@ class PayChannelController extends ThinkController
}
if (!empty($_REQUEST['user_account'])) {
$map['user_account'] = array('like',"{$_REQUEST['user_account']}%");
$map['tab_spend.user_account'] = array('like',"{$_REQUEST['user_account']}%");
}
$map['pay_status'] = $coinMap['tab_deposit.pay_status'] = 1;
$map['pay_way'] = array('egt',1);
if ($_REQUEST['pay_way'] || $_REQUEST['pay_way']=='0') {
$map['pay_way'] = $_REQUEST['pay_way'];
}
$model = $_REQUEST['model']?$_REQUEST['model']:'spend';
$data = [];
@ -1003,7 +1009,7 @@ class PayChannelController extends ThinkController
}
// 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,sdk_version")
->field("pay_order_number,order_number,tab_spend.user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status,sdk_version")
->join('inner join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id')
->where($map)
// ->order('tab_spend.id DESC')
@ -1013,9 +1019,22 @@ class PayChannelController extends ThinkController
$map['tab_deposit.user_account'] = $map['user_account'];
}
$map['user_account'] = $map['tab_spend.user_account'];
unset($map['tab_spend.user_account']);
$coinMap = $map;
$map['tab_spend.user_account'] = array('like',"{$_REQUEST['user_account']}%");
$coinMap['tab_deposit.pay_status'] = 1;
$coinMap['tab_deposit.pay_way'] = $map['pay_way'];
$coinMap['tab_deposit.user_account'] = $coinMap['user_account'];
unset($coinMap['user_account']);
if(!$coinMap['tab_deposit.user_account']) {
unset($coinMap['tab_deposit.user_account']);
}
if (!$map['user_account']) {
unset($map['user_account']);
}
unset($coinMap['pay_status']);
unset($coinMap['pay_way']);
@ -1031,11 +1050,13 @@ class PayChannelController extends ThinkController
->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")
->field("pay_order_number,tab_deposit.order_number,tab_deposit.user_account,tab_deposit.create_time as pay_time,
tab_pay_info.game_name,tab_pay_info.server_name,tab_pay_info.game_player_name,tab_pay_info.sdk_version,tab_deposit.pay_amount as cost,
tab_deposit.pay_amount,tab_deposit.pay_way as pay_type,tab_deposit.pay_way,'' as pay_game_status")
tab_pay_info.game_name,tab_pay_info.server_name,tab_pay_info.game_player_name,tab_deposit.pay_amount as cost,
tab_deposit.pay_amount,tab_deposit.pay_way as pay_type,tab_deposit.pay_way,'' as pay_game_status,tab_pay_info.sdk_version")
->where($coinMap)
->select(false);
// var_dump($coinData);die();
$page = ($page-1) * $row;
$count = "select count(*) as count from ({$data} UNION ALL {$coinData})t;";
@ -1328,6 +1349,10 @@ class PayChannelController extends ThinkController
$map['pay_way'] = array('egt',1);
$model = $_REQUEST['model']?$_REQUEST['model']:'spend';
if ($_REQUEST['pay_way'] || $_REQUEST['pay_way']=='0') {
$map['pay_way'] = $_REQUEST['pay_way'];
}
$data = [];
$csvFileName = $xlsName.'.csv';
@ -1362,18 +1387,31 @@ class PayChannelController extends ThinkController
// ->order('tab_spend.id DESC')
->select(false);
if ($map['user_account']) {
$map['tab_deposit.user_account'] = $map['user_account'];
}
// if ($map['user_account']) {
// $map['tab_deposit.user_account'] = $map['user_account'];
// }
$map['user_account'] = $map['tab_spend.user_account'];
unset($map['tab_spend.user_account']);
$coinMap = $map;
$coinMap['tab_deposit.pay_status'] = 1;
$coinMap['tab_deposit.pay_way'] = $map['pay_way'];
unset($coinMap['pay_status']);
unset($coinMap['pay_way']);
$coinMap['tab_deposit.user_account'] = $coinMap['user_account'];
unset($coinMap['user_account']);
if(!$coinMap['tab_deposit.user_account']) {
unset($coinMap['tab_deposit.user_account']);
}
if (!$map['user_account']) {
unset($map['user_account']);
}
if($map['pay_time']) {
$coinMap['tab_deposit.create_time'] = $map['pay_time'];
@ -1686,6 +1724,7 @@ class PayChannelController extends ThinkController
$sumAllDataother['user_account'] = '------';
$sumAllDataother['pay_time'] = '------';
$sumAllDataother['game_name'] = '------';
$sumAllDataother['sdk_version'] = '------';
$sumAllDataother['server_name'] = '------';
$sumAllDataother['game_player_name'] = '------';
$sumAllDataother['cost'] = $sumAllData['cost'];

@ -49,17 +49,29 @@ class PayChannelIntentionController extends AdminController
}
if ($_REQUEST['pay_type']) {
$map['pay_ways'] = ['like',"%,{$_REQUEST['pay_type']}"];
$map['pay_ways'] = ['like',"%{$_REQUEST['pay_type']}"];
}
$show_data = M('pay_channel_intention','tab_')
->field('group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number,create_time')
->field('id,group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time DESC')
->select(false);
$show_data = M('pay_channel_intention','tab_')
->field("a.pay_amount,pay_ways,a.user_account,a.pay_order_number,tab_pay_channel_intention.create_time,CASE WHEN is_submit = 1 THEN tab_pay_channel_intention.pay_status ELSE 2 END as pay_status")
->join("left join ({$show_data}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
// ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.id DESC')
->select(false);
$show_data = M()->table('('.$show_data.') as a')
->select(false);
$data = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,pay_status,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
@ -72,6 +84,14 @@ class PayChannelIntentionController extends AdminController
->group('a.pay_ways,a.user_account,a.pay_status')
->select(false);
// dump($data);die();
$count = M()->table('('.$data.') as a')
->field('pay_ways,sum(fail_invest_amount) fail_invest_amount')
->where($map)
->group('a.pay_ways')
->select(false);
// dump($count);die();
$data = M()->table('('.$data.') as a')
->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,create_time,
sum(success_invest_amount) success_invest_amount,
@ -93,9 +113,23 @@ class PayChannelIntentionController extends AdminController
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->where($map)
->group('a.pay_ways,a.user_account,a.pay_status')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field('pay_ways,user_account,pay_status,create_time,
SUM(if(pay_status=0,fail_invest_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,success_invest_amount,0)) success_invest_amount,
SUM(if(pay_status=2,nothing_invest_amount,0)) nothing_invest_amount,
count(if(pay_status=0,fail_invest_count,null)) fail_invest_count,
count(if(pay_status=1,success_invest_count,null)) success_invest_count,
count(if(pay_status=2,nothing_invest_count,null)) nothing_invest_count')
->group('a.user_account,a.pay_status')
->select(false);
// dump($sum);die();
$sum = M()->table('('.$sum.') as a')
->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,
sum(success_invest_amount) success_invest_amount,
@ -103,16 +137,13 @@ class PayChannelIntentionController extends AdminController
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count')
->where($map)
->find();
// dump($sum);die();
$this->assign('sum',$sum);
$count = M()->table('('.$show_data.') as a')
->field('count(pay_amount) count')
->group('a.pay_ways')
->select(false);
$count = M()->table('('.$count.') as a')->count();
@ -165,17 +196,29 @@ class PayChannelIntentionController extends AdminController
}
if ($_REQUEST['pay_type']) {
$map['pay_ways'] = ['like',"%,{$_REQUEST['pay_type']}"];
$map['pay_ways'] = ['like',"%{$_REQUEST['pay_type']}"];
}
$show_data = M('pay_channel_intention','tab_')
->field('group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number')
->field('id,group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time DESC')
->select(false);
$show_data = M('pay_channel_intention','tab_')
->field("a.pay_amount,pay_ways,a.user_account,a.pay_order_number,tab_pay_channel_intention.create_time,CASE WHEN is_submit = 1 THEN tab_pay_channel_intention.pay_status ELSE 2 END as pay_status")
->join("left join ({$show_data}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
// ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.id DESC')
->select(false);
$show_data = M()->table('('.$show_data.') as a')
->select(false);
$data = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,pay_status,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
@ -183,8 +226,8 @@ class PayChannelIntentionController extends AdminController
SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->where($map)
count(if(pay_status=2,pay_amount,null)) nothing_invest_count,create_time')
// ->where($map)
->group('a.pay_ways,a.user_account,a.pay_status')
->select(false);
@ -218,10 +261,10 @@ class PayChannelIntentionController extends AdminController
->field('"" as pay_ways_ch,"" as pay_way,pay_ways,user_account,
count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
sum(success_invest_amount) success_invest_amount,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count,
sum(nothing_invest_amount) nothing_invest_amount,
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
sum(fail_invest_amount) fail_invest_amount')
sum(fail_invest_amount) fail_invest_amount,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count,
sum(nothing_invest_amount) nothing_invest_amount')
->limit(($i-1)*$perSize ,$perSize)
->where($map)
->group('a.pay_ways')
@ -265,13 +308,24 @@ class PayChannelIntentionController extends AdminController
}
$sum = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,pay_status,
->field('pay_ways,user_account,pay_status,create_time,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->where($map)
->group('a.pay_ways,a.user_account,a.pay_status')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field('pay_ways,user_account,pay_status,create_time,
SUM(if(pay_status=0,fail_invest_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,success_invest_amount,0)) success_invest_amount,
SUM(if(pay_status=2,nothing_invest_amount,0)) nothing_invest_amount,
count(if(pay_status=0,fail_invest_count,null)) fail_invest_count,
count(if(pay_status=1,success_invest_count,null)) success_invest_count,
count(if(pay_status=2,nothing_invest_count,null)) nothing_invest_count')
->group('a.user_account,a.pay_status')
->select(false);
@ -279,34 +333,14 @@ class PayChannelIntentionController extends AdminController
->field('"汇总(检索时间内所有数据的统计)" pay_ways,"" other,
count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
sum(success_invest_amount) success_invest_amount,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count,
sum(nothing_invest_amount) nothing_invest_amount,
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
sum(fail_invest_amount) fail_invest_amount
sum(fail_invest_amount) fail_invest_amount,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count,
sum(nothing_invest_amount) nothing_invest_amount
')
->where($map)
->find();
// $sum = M()->table('('.$show_data.') as a')
// ->field('pay_ways,user_account,
// SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
// SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
// SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
// count(if(pay_status=0,pay_amount,null)) fail_invest_count,
// count(if(pay_status=1,pay_amount,null)) success_invest_count,
// count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
// ->group('a.pay_ways')
// ->select(false);
//
// $sum = M()->table('('.$sum.') as a')
// ->field('"" as pay_ways_ch,"" as pay_way,
// sum(success_invest_count) success_invest_count,
// sum(success_invest_amount) success_invest_amount,
// sum(nothing_invest_count) nothing_invest_count,
// sum(nothing_invest_amount) nothing_invest_amount,
// sum(fail_invest_count) fail_invest_count,
// sum(fail_invest_amount) fail_invest_amount')
// ->find();
mb_convert_variables('GBK', 'UTF-8', $sum);
fputcsv($fp, $sum);
//刷新输出缓冲到浏览器
@ -334,9 +368,14 @@ class PayChannelIntentionController extends AdminController
$map = [];
if ($_REQUEST['pay_way']) {
$map['pay_ways'] = $_REQUEST['pay_way'];
}
if ($_REQUEST['pay_ways']) {
$map['pay_ways'] = $_REQUEST['pay_ways'];
$map['pay_ways'] = ['like',"%{$_REQUEST['pay_ways']}"];
}
// var_dump($map);die();
if ($_REQUEST['user_account']) {
$map['user_account'] = $_REQUEST['user_account'];
@ -369,25 +408,35 @@ class PayChannelIntentionController extends AdminController
// $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
// var_dump($map);die();
$data = M('pay_channel_intention','tab_')
->field('group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,
->field('id,group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,
count(if(tab_pay_channel_intention.pay_way="alipay",tab_pay_channel_intention.pay_way,null)) alipay,
count(if(tab_pay_channel_intention.pay_way="wxpay",tab_pay_channel_intention.pay_way,null)) wxpay,
count(if(tab_pay_channel_intention.pay_way="sqpay",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="yeepay",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time DESC')
->order('tab_pay_channel_intention.id DESC')
->select(false);
$data = M('pay_channel_intention','tab_')
->field('a.*,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status')
->join("left join ({$data}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
->select(false);
// var_dump($data);die();
// dump($data);die();
$count = M()->table('('.$data.') as a')
->field('id')
->where($map)
->count();
@ -410,14 +459,20 @@ class PayChannelIntentionController extends AdminController
count(if(tab_pay_channel_intention.pay_way="yeepay",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
$sum = M('pay_channel_intention','tab_')
->field('a.*,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status')
->join("left join ({$sum}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field("sum(pay_amount) pay_amount,sum(alipay) alipay,sum(wxpay) wxpay,sum(sqshorcut) sqshorcut,sum(shorcut) shorcut")
->where($map)
@ -477,19 +532,26 @@ class PayChannelIntentionController extends AdminController
}
$data = M('pay_channel_intention','tab_')
->field('group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,
->field('id,group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,
count(if(tab_pay_channel_intention.pay_way="alipay",tab_pay_channel_intention.pay_way,null)) alipay,
count(if(tab_pay_channel_intention.pay_way="wxpay",tab_pay_channel_intention.pay_way,null)) wxpay,
count(if(tab_pay_channel_intention.pay_way="sqpay",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="yeepay",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time DESC')
->order('tab_pay_channel_intention.id DESC')
->select(false);
$data = M('pay_channel_intention','tab_')
->field('a.*,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status')
->join("left join ({$data}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
->select(false);
$csvFileName = $xlsName.'.csv';
@ -559,14 +621,20 @@ class PayChannelIntentionController extends AdminController
count(if(tab_pay_channel_intention.pay_way="yeepay",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time,max(create_time) m_time')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
$sum = M('pay_channel_intention','tab_')
->field('a.*,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status')
->join("left join ({$sum}) as a on tab_pay_channel_intention.pay_order_number=a.pay_order_number and tab_pay_channel_intention.create_time=m_time")
->where('pay_ways is not null')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field("'汇总(检索时间内所有数据的统计)' as user_account,sum(pay_amount) pay_amount,sum(alipay) alipay,sum(wxpay) wxpay,sum(sqshorcut) sqshorcut,sum(shorcut) shorcut")
->where($map)

@ -22,7 +22,7 @@ class TestOrderController extends ThinkController
$map['1'] = "1";
if (!empty($_REQUEST['server_type'])) {
$map['server_type'] = $_REQUEST['server_type'];
$map['t.server_type'] = $_REQUEST['server_type'];
}
if (!empty($_REQUEST['order_type'])||$_REQUEST['order_type'] == '0') {
$map['order_type'] = $_REQUEST['order_type'];
@ -55,8 +55,8 @@ class TestOrderController extends ThinkController
$v['game_name'] =clearGameNameType($v['game_name']);
$v['sdk_version'] =getGameTypeName($v['sdk_version']);
}
$sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
$sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
$sum_order_amount = M('test_order', 'tab_')->alias("t")->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find();
$sum_pay_amount = M('test_order', 'tab_')->alias("t")->where($map)->field('sum(pay_amount) as sum_order_amount')->find();
$count = $sum_order_amount['count'];
$page = set_pagination($count, $row);

@ -33,6 +33,9 @@
<input type="hidden" name="game_id" value="{$_GET['game_id']}"/>
<input type="hidden" name="game_name" value="{$_GET['game_name']}"/>
<input type="hidden" name="timestart" value="{$_GET['timestart']}"/>
<input type="hidden" name="timeend" value="{$_GET['timeend']}"/>
<input type="hidden" name="pay_way" value="{$_GET['pay_way']}"/>
<div class="input-list">
<input type="text" name="pay_order_number" placeholder="请输入支付订单号" class="" value="{:I('pay_order_number')}" style="width: 180px"/>&nbsp;

@ -232,7 +232,7 @@
<td>0.00</td>
<td><if condition="$sum_pay_amount['sum_order_amount'] neq ''">{$sum_pay_amount['sum_order_amount']}<else/>0.00</if></td>
<td>
<a href="{:U('TestOrder/lists')}" >订单查看</a>
<a href="{:U('TestOrder/lists',array_merge([],I('get.')))}" >订单查看</a>
</td>
</tr>
</notemtpy>

@ -89,8 +89,6 @@
<option value="9">双乾支付-支付宝</option>
<option value="10">双乾支付-银联</option>
<option value="15">双乾支付-快捷</option>
<option value="0">平台币</option>
<option value="-1">绑币</option>
<option value="17">易宝支付</option>
</select>
</div>

@ -231,9 +231,9 @@
<option value="">请选择支付状态</option>
<option value="1" <if condition="$_GET['pay_status'] eq '1'">selected</if>>支付成功</option>
<option value="4" <if condition="$_GET['pay_status'] eq '4'">selected</if>>支付成功通知成功</option>
<option value="2" <if condition="$_GET['pay_status'] eq '2'">selected</if>>下单未支付</option>
<option value="2" <if condition="$_GET['pay_status'] eq '2'">selected</if>>支付失败</option>
<option value="3" <if condition="$_GET['pay_status'] eq '3'">selected</if>>支付成功通知失败</option>
<option value="0" <if condition="$_GET['pay_status'] eq '0'">selected</if>>支付失败</option>
<option value="0" <if condition="$_GET['pay_status'] eq '0'">selected</if>>下单未支付</option>
</select>
</div>
@ -309,8 +309,8 @@
<td >{$data.shorcut}</td>
<td >{$data.sqshorcut}</td>
<td >{$data.create_time}</td>
<td ><if condition="$data.pay_status eq 0"> 支付失败 <elseif condition="$data.pay_status eq 2"/> 下单未支付 <else/> 支付成功 </if><br>
<if condition="$data.pay_game_status eq 0"> 通知失败 <elseif condition="$data.pay_game_status eq 2"/> 未通知 <else/> 通知成功 </if></td>
<td ><if condition="$data.pay_status eq 2"> 支付失败 <elseif condition="$data.pay_status eq 0"/> 下单未支付 <else/> 支付成功 </if><br>
<if condition="$data.pay_game_status eq 2"> 通知失败 <elseif condition="$data.pay_game_status eq 0"/> 未通知 <else/> 通知成功 </if></td>
<td >{$data.pay_order_number}</td>
</tr>
</volist>

@ -223,8 +223,8 @@
<option value="">请选择最终使用方式</option>
<option value="alipay" <if condition="$_GET['pay_type'] eq 'alipay'">selected</if>>支付宝</option>
<option value="wxpay" <if condition="$_GET['pay_type'] eq 'wxpay'">selected</if>>微信支付</option>
<option value="shorcut" <if condition="$_GET['pay_type'] eq 'shorcut'">selected</if>>易宝支付</option>
<option value="sqshorcut" <if condition="$_GET['pay_type'] eq 'sqshorcut'">selected</if>>双乾快捷支付</option>
<option value="yeepay" <if condition="$_GET['pay_type'] eq 'yeepay'">selected</if>>易宝支付</option>
<option value="sqpay" <if condition="$_GET['pay_type'] eq 'sqpay'">selected</if>>双乾快捷支付</option>
</select>
</div>
@ -295,21 +295,21 @@
<td >{$data.pay_way}</td>
<td ><a class="detail" data-way="{$data.pay_ways}" data-status="1">{$data.success_invest_count}</a></td>
<td >{$data.success_invest_amount}</td>
<td ><a class="detail" data-way="{$data.pay_ways}" data-status="2">{$data.nothing_invest_count}</a></td>
<td >{$data.nothing_invest_amount}</td>
<td ><a class="detail" data-way="{$data.pay_ways}" data-status="0">{$data.fail_invest_count}</a></td>
<td >{$data.fail_invest_amount}</td>
<td ><a class="detail" data-way="{$data.pay_ways}" data-status="2">{$data.nothing_invest_count}</a></td>
<td >{$data.nothing_invest_amount}</td>
</tr>
</volist>
<tr>
<td colspan="2">汇总(检索时间内所有数据的统计)</td>
<td ></td>
<td ><a class="detail" data-status="1">{$sum.success_invest_count}</a></td>
<td ><a class="detail" data-ways="{$_GET['pay_type']}" data-status="1">{$sum.success_invest_count}</a></td>
<td >{$sum.success_invest_amount}</td>
<td ><a class="detail" data-status="2">{$sum.nothing_invest_count}</a></td>
<td >{$sum.nothing_invest_amount}</td>
<td ><a class="detail" data-status="0">{$sum.fail_invest_count}</a></td>
<td ><a class="detail" data-ways="{$_GET['pay_type']}" data-status="0">{$sum.fail_invest_count}</a></td>
<td >{$sum.fail_invest_amount}</td>
<td ><a class="detail" data-ways="{$_GET['pay_type']}" data-status="2">{$sum.nothing_invest_count}</a></td>
<td >{$sum.nothing_invest_amount}</td>
</tr>
</notemtpy>
</tbody>
@ -367,12 +367,19 @@
$('.detail').click(function () {
var pay_way = $(this).attr('data-way');
var pay_ways = $(this).attr('data-ways');
if (pay_way) {
pay_way = 'pay_ways/' + pay_way + '/';
pay_way = 'pay_way/' + pay_way + '/';
} else {
pay_way = '';
}
if (pay_ways) {
pay_ways = 'pay_ways/' + pay_ways + '/';
} else {
pay_ways = '';
}
var pay_status = $(this).attr('data-status');
if (pay_status) {
@ -381,7 +388,7 @@
pay_status = '';
}
var url = "admin.php?s=/PayChannelIntention/detail/" + pay_way + pay_status;
var url = "admin.php?s=/PayChannelIntention/detail/"+ pay_ways + pay_way + pay_status;
window.location.href = url;

@ -155,11 +155,11 @@
<td ><if condition="$data.server_type eq 1">测试内网<else/>测试外网</if></td>
<td >{$data.order_type|get_order_type}</td>
<td >{$data.order_no}</td>
<td >{$data.cp_order_no}</td>
<if condition="$_GET['model'] neq 'game_supersign'"><td >{$data.cp_order_no}</td></if>
<td >{$data.user_account}</td>
<td >{$data.pay_time|date='Y-m-d H:i:s',###}</td>
<td >{$data.game_name}</td>
<td >{$data.sdk_version}</td>
<if condition="$_GET['model'] neq 'deposit'"><td >{$data.game_name}</td></if>
<if condition="$_GET['model'] neq 'deposit'"><td >{$data.sdk_version}</td></if>
<td >{$data.order_amount}</td>
<td >{$data.pay_amount}</td>
<td >{$data.pay_way|get_pay_way}</td>

Loading…
Cancel
Save