Merge branch 'feature/pay_white_list' of wmtx/platform into release

支付渠道意愿统计bug上传
master
张谷诚 5 years ago committed by Gogs
commit e42281bdfe

@ -54,7 +54,7 @@ class PayChannelIntentionController extends AdminController
$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')
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')
// ->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')
@ -67,13 +67,13 @@ 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);
$data = M()->table('('.$data.') as a')
->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,
->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,create_time,
sum(success_invest_amount) success_invest_amount,
sum(nothing_invest_amount) nothing_invest_amount,
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
@ -86,7 +86,7 @@ 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,
@ -170,12 +170,24 @@ class PayChannelIntentionController extends AdminController
$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 pay_status is null THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
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')
// ->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);
$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,
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);
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
@ -202,27 +214,38 @@ class PayChannelIntentionController extends AdminController
for($i = 1; $i <= $pages; $i++) {
$xlsData = M()->table('('.$show_data.') as a')
$xlsData = M()->table('('.$data.') as a')
->field('"" as pay_ways_ch,"" as pay_way,pay_ways,user_account,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count,
SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount')
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')
->limit(($i-1)*$perSize ,$perSize)
->where($map)
->group('a.pay_ways,a.user_account,a.pay_status')
->group('a.pay_ways')
->select();
// $xlsData = M()->table('('.$show_data.') as a')
// ->field('"" as pay_ways_ch,"" as pay_way,pay_ways,user_account,
// count(if(pay_status=1,pay_amount,null)) success_invest_count,
// SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
// count(if(pay_status=2,pay_amount,null)) nothing_invest_count,
// SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
// count(if(pay_status=0,pay_amount,null)) fail_invest_count,
// SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount')
// ->limit(($i-1)*$perSize ,$perSize)
// ->where($map)
// ->group('a.pay_ways,a.user_account,a.pay_status')
// ->select();
foreach($xlsData as $key =>$value) {
$arr = explode(',',$value['pay_ways']);
$value['pay_way'] = self::$arr_pay_way[end($arr)];
$value['pay_ways_ch'] = '';
foreach ($arr as $k=>$v) {
$value['pay_ways_ch'] = $value['pay_ways_ch'].($k+1).','.self::$arr_pay_way[$v];
@ -242,25 +265,48 @@ class PayChannelIntentionController extends AdminController
}
$sum = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,
->field('pay_ways,user_account,pay_status,
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')
->group('a.user_account,a.pay_status')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field('"" as pay_ways_ch,"" as pay_way,
sum(success_invest_count) success_invest_count,
->field('"汇总(检索时间内所有数据的统计)" pay_ways,"" other,
count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
sum(success_invest_amount) success_invest_amount,
sum(nothing_invest_count) nothing_invest_count,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count,
sum(nothing_invest_amount) nothing_invest_amount,
sum(fail_invest_count) fail_invest_count,
sum(fail_invest_amount) fail_invest_amount')
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
sum(fail_invest_amount) fail_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);
//刷新输出缓冲到浏览器
@ -298,18 +344,37 @@ class PayChannelIntentionController extends AdminController
if ($_REQUEST['pay_status'] || $_REQUEST['pay_status'] == '0') {
$map['pay_status'] = $_REQUEST['pay_status'];
if ($_REQUEST['pay_status'] == 3) {
if ($_REQUEST['pay_status'] == 4) {
$map['pay_status'] = 1;
$map['pay_game_status'] = 1;
}
if ($_REQUEST['pay_status'] == 3) {
$map['pay_status'] = 1;
$map['pay_game_status'] = 0;
}
}
if ($_REQUEST['timestart']&&!$_REQUEST['timeend']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['timestart'])];
}
if (!$_REQUEST['timestart']&&$_REQUEST['timeend']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['timeend'])+86399];
}
if ($_REQUEST['timestart']&&$_REQUEST['timeend']) {
$map['create_time'] = ['between',[strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+86399]];
// $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
$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,
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="sqshorcut",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
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,
@ -317,7 +382,7 @@ class PayChannelIntentionController extends AdminController
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')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->order('tab_pay_channel_intention.create_time DESC')
->select(false);
// var_dump($data);die();
@ -341,8 +406,8 @@ class PayChannelIntentionController extends AdminController
->field('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="sqshorcut",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
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,
@ -398,12 +463,25 @@ class PayChannelIntentionController extends AdminController
}
}
if ($_REQUEST['timestart']&&!$_REQUEST['timeend']) {
$map['create_time'] = ['egt',strtotime($_REQUEST['timestart'])];
}
if (!$_REQUEST['timestart']&&$_REQUEST['timeend']) {
$map['create_time'] = ['elt',strtotime($_REQUEST['timeend'])+86399];
}
if ($_REQUEST['timestart']&&$_REQUEST['timeend']) {
$map['create_time'] = ['between',[strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+86399]];
// $map['create_time'] = ['elt',strtotime($_REQUEST['time_end'])];
}
$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,
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="sqshorcut",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
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,
@ -411,7 +489,7 @@ class PayChannelIntentionController extends AdminController
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')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->order('tab_pay_channel_intention.create_time DESC')
->select(false);
$csvFileName = $xlsName.'.csv';
@ -477,8 +555,8 @@ class PayChannelIntentionController extends AdminController
->field('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="sqshorcut",tab_pay_channel_intention.pay_way,null)) sqshorcut,
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
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 pay_status is null THEN 2 ELSE pay_status END as pay_status,

@ -229,7 +229,8 @@
<div class="input-list input-list-server search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" style="color: #404040;">
<option value="">请选择支付状态</option>
<option value="1" <if condition="$_GET['pay_status'] eq '1'">selected</if>>支付成功通知成功</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="3" <if condition="$_GET['pay_status'] eq '3'">selected</if>>支付成功通知失败</option>
<option value="0" <if condition="$_GET['pay_status'] eq '0'">selected</if>>支付失败</option>
@ -361,6 +362,23 @@
//导航高亮
highlight_subnav('{:U('PayChannelIntention/index')}');
$('#timestart').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
pickerPosition:'bottom-left'
})
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');

@ -1522,4 +1522,11 @@ CREATE TABLE `tab_pay_channel_intention` (
ALTER TABLE `tab_pay_channel_intention`
ADD COLUMN `pay_status` tinyint(2) NULL DEFAULT 0 COMMENT '支付状态 0未支付 1已支付' AFTER `create_time`;
ALTER TABLE `tab_pay_channel_intention`
ADD COLUMN `pay_game_status` tinyint(2) NULL DEFAULT 0 COMMENT '支付状态 0未支付 1已支付' AFTER `create_time`;
ADD COLUMN `pay_game_status` tinyint(2) NULL DEFAULT 0 COMMENT '支付状态 0未支付 1已支付' AFTER `create_time`;
CREATE TABLE `tab_pay_intention_num` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`num` int(11) NULL DEFAULT 0 COMMENT '支付意愿支付次数',
`pay_order_number` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '支付单号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = INNODB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
Loading…
Cancel
Save