市场结算管理优化

master
zhengyongxing 5 years ago
parent 4ce89ee670
commit f7c9730153

@ -20,7 +20,7 @@ use Com\WechatAuth;
class PayChannelIntentionController extends AdminController class PayChannelIntentionController extends AdminController
{ {
public static $arr_pay_way = ['alipay'=>'支付宝','wxpay'=>'微信支付','sqshorcut'=>'双乾快捷支付','shorcut'=>'易宝支付']; public static $arr_pay_way = ['alipay'=>'支付宝','wxpay'=>'微信支付','sqpay'=>'双乾快捷支付','yeepay'=>'易宝支付'];
public function index($p = 0) { public function index($p = 0) {
@ -54,58 +54,59 @@ class PayChannelIntentionController extends AdminController
$show_data = M('pay_channel_intention','tab_') $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, ->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') 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') // ->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') ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC') ->order('tab_pay_channel_intention.create_time ASC')
->select(false); ->select(false);
$data = M()->table('('.$show_data.') as a') $data = 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=0,pay_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount, SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
SUM(if(pay_status=2,pay_amount,0)) nothing_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=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count, count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count') count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->page($page,$row)
->where($map) ->where($map)
->group('a.pay_ways,a.user_account,a.pay_status') ->group('a.pay_ways,a.user_account,a.pay_status')
->select(); ->select(false);
// $data = M()->table('('.$show_data.') as a') $data = M()->table('('.$data.') as a')
// ->field('pay_ways,user_account, ->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,
// SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount, sum(success_invest_amount) success_invest_amount,
// SUM(if(pay_status=1,pay_amount,0)) success_invest_amount, sum(nothing_invest_amount) nothing_invest_amount,
// SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount, count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
// count(if(pay_status=0,pay_amount,null)) fail_invest_count, count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
// count(if(pay_status=1,pay_amount,null)) success_invest_count, count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count')
// count(if(pay_status=2,pay_amount,null)) nothing_invest_count') ->page($page,$row)
// ->page($page,$row) ->where($map)
// ->group('a.pay_ways') ->group('a.pay_ways')
// ->select(); ->select();
$sum = M()->table('('.$show_data.') as a') $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=0,pay_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount, SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
SUM(if(pay_status=2,pay_amount,0)) nothing_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=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count, count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_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); ->select(false);
$sum = M()->table('('.$sum.') as a') $sum = M()->table('('.$sum.') as a')
->field("sum(fail_invest_amount) fail_invest_amount, ->field('pay_ways,sum(fail_invest_amount) fail_invest_amount,
sum(success_invest_amount) success_invest_amount, sum(success_invest_amount) success_invest_amount,
sum(nothing_invest_amount) nothing_invest_amount, sum(nothing_invest_amount) nothing_invest_amount,
sum(fail_invest_count) fail_invest_count, count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
sum(success_invest_count) success_invest_count, count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
sum(nothing_invest_count) nothing_invest_count") count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count')
->where($map)
->find(); ->find();
$this->assign('sum',$sum); $this->assign('sum',$sum);
$count = M()->table('('.$show_data.') as a') $count = M()->table('('.$show_data.') as a')
@ -311,14 +312,16 @@ class PayChannelIntentionController extends AdminController
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="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account, tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount, tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status, CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_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')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.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') ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC') ->order('tab_pay_channel_intention.create_time ASC')
->select(false); ->select(false);
// var_dump($data);die();
$count = M()->table('('.$data.') as a') $count = M()->table('('.$data.') as a')
->where($map) ->where($map)
->count(); ->count();
@ -342,10 +345,10 @@ class PayChannelIntentionController extends AdminController
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="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account, tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount, tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status, CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_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')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.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') ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC') ->order('tab_pay_channel_intention.create_time ASC')
->select(false); ->select(false);
@ -403,10 +406,10 @@ class PayChannelIntentionController extends AdminController
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="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account, tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount, tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status, CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_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')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.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') ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC') ->order('tab_pay_channel_intention.create_time ASC')
->select(false); ->select(false);
@ -481,7 +484,7 @@ class PayChannelIntentionController extends AdminController
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status, CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_status, CASE WHEN pay_game_status is null 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')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.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') ->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC') ->order('tab_pay_channel_intention.create_time ASC')
->select(false); ->select(false);

@ -224,7 +224,7 @@
</div> </div>
<input type="text" name="pay_ways" placeholder="请选择支付状态" class="" <input type="text" name="pay_ways" placeholder="请选择支付状态" class=""
value="$_GET['pay_ways']" style="display: none"> value="{$_GET['pay_ways']}" style="display: none">
<div class="input-list input-list-server search_label_rehab"> <div class="input-list input-list-server search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" style="color: #404040;"> <select id="pay_status" name="pay_status" class="select_gallery" style="color: #404040;">
@ -232,7 +232,7 @@
<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="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="3" <if condition="$_GET['pay_status'] eq '3'">selected</if>>支付成功通知失败</option>
<option value="0" <if condition="$_GET['pay_status'] eq '4'">selected</if>>支付失败</option> <option value="0" <if condition="$_GET['pay_status'] eq '0'">selected</if>>支付失败</option>
</select> </select>
</div> </div>
@ -309,7 +309,7 @@
<td >{$data.sqshorcut}</td> <td >{$data.sqshorcut}</td>
<td >{$data.create_time}</td> <td >{$data.create_time}</td>
<td ><if condition="$data.pay_status eq 0"> 支付失败 <elseif condition="$data.pay_status eq 2"/> 下单未支付 <else/> 支付成功 </if><br> <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_status eq 2"/> 未通知 <else/> 通知成功 </if></td> <if condition="$data.pay_game_status eq 0"> 通知失败 <elseif condition="$data.pay_game_status eq 2"/> 未通知 <else/> 通知成功 </if></td>
<td >{$data.pay_order_number}</td> <td >{$data.pay_order_number}</td>
</tr> </tr>
</volist> </volist>
@ -361,6 +361,13 @@
//导航高亮 //导航高亮
highlight_subnav('{:U('PayChannelIntention/index')}'); highlight_subnav('{:U('PayChannelIntention/index')}');
$('.page a').click(function () {
var href = $(this).attr('href');
$(this).removeAttr('href');
window.location.replace(href)
console.log(href)
});
$('#forbit').click(function () { $('#forbit').click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val(); return $(elem).val();

@ -344,6 +344,22 @@
//导航高亮 //导航高亮
highlight_subnav('{:U('PayChannelIntention/index')}'); 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'
})
$('.detail').click(function () { $('.detail').click(function () {
var pay_way = $(this).attr('data-way'); var pay_way = $(this).attr('data-way');

@ -1518,4 +1518,8 @@ CREATE TABLE `tab_pay_channel_intention` (
`pay_order_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '支付订单号', `pay_order_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '支付订单号',
`create_time` int(11) NULL DEFAULT 0 COMMENT '创建时间', `create_time` int(11) NULL DEFAULT 0 COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
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`;
Loading…
Cancel
Save