支付渠道跳转增加

master
zhengyongxing 4 years ago
parent 9a722d5b45
commit 0c4f1f05bd

@ -196,30 +196,46 @@ class PayChannelController extends ThinkController
$channelData = $this->getPayChannel($map); $channelData = $this->getPayChannel($map);
$testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder); $testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder);
$payTypeData['支付宝支付金额'] = 0; $payTypeData['支付宝支付金额']['amount'] = 0;
$payTypeData['微信支付金额'] = 0; $payTypeData['微信支付金额']['amount'] = 0;
$payTypeData['快捷支付金额'] = 0; $payTypeData['快捷支付金额']['amount'] = 0;
$payTypeData['苹果支付金额'] = 0; $payTypeData['苹果支付金额']['amount'] = 0;
$payTypeData['汇付宝支付金额'] = 0; $payTypeData['汇付宝支付金额']['amount'] = 0;
$payTypeData['易宝支付金额'] = 0; $payTypeData['易宝支付金额']['amount'] = 0;
$payTypeData['其他支付金额'] = 0; $payTypeData['其他支付金额']['amount'] = 0;
$payTypeData['支付宝支付金额']['pay_way'] = "1,9";
$payTypeData['微信支付金额']['pay_way'] = "2,3";
$payTypeData['快捷支付金额']['pay_way'] = "4";
$payTypeData['苹果支付金额']['pay_way'] = "15";
$payTypeData['汇付宝支付金额']['pay_way'] = "7";
$payTypeData['易宝支付金额']['pay_way'] = "17";
$payTypeData['其他支付金额']['pay_way'] = "1,9,4,2,3,15,7,17";
$payTypeData['支付宝支付金额']['type'] = "in";
$payTypeData['微信支付金额']['type'] = "in";
$payTypeData['快捷支付金额']['type'] = "in";
$payTypeData['苹果支付金额']['type'] = "in";
$payTypeData['汇付宝支付金额']['type'] = "in";
$payTypeData['易宝支付金额']['type'] = "in";
$payTypeData['其他支付金额']['type'] = "not in";
foreach($channelData as $key => $value) { foreach($channelData as $key => $value) {
if ($value['pay_way']==1 || $value['pay_way']==9 ) { if ($value['pay_way']==1 || $value['pay_way']==9 ) {
$payTypeData['支付宝支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['支付宝支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if ($value['pay_way']==4 ) { } else if ($value['pay_way']==4 ) {
$payTypeData['汇付宝支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['汇付宝支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if ($value['pay_way']==2 || $value['pay_way']==3 ) { } else if ($value['pay_way']==2 || $value['pay_way']==3 ) {
$payTypeData['微信支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['微信支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if ($value['pay_way']==15) { } else if ($value['pay_way']==15) {
$payTypeData['快捷支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['快捷支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if($value['pay_way'] ==7){ } else if($value['pay_way'] ==7){
$payTypeData['苹果支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['苹果支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if($value['pay_way'] ==17){ } else if($value['pay_way'] ==17){
$payTypeData['易宝支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['易宝支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} else if($value['pay_way']){ } else if($value['pay_way']){
$payTypeData['其他支付金额'] += number_format($value['pay_amount'],2,'.',''); $payTypeData['其他支付金额']['amount'] += number_format($value['pay_amount'],2,'.','');
} }
} }

@ -15,7 +15,7 @@ class PayMerchantController extends ThinkController
const WAY_EXPRESS = 4; const WAY_EXPRESS = 4;
public function index($p = 0) { public function index($p = 0) {
if(!array_key_exists("timestart",$_REQUEST)){ if(!array_key_exists("timestart",$_REQUEST)&&!$_REQUEST['type']){
$this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d'))); $this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d')));
} }
$page = intval($p); $page = intval($p);
@ -50,12 +50,16 @@ class PayMerchantController extends ThinkController
$map['main_name'] = $_REQUEST['main_name']; $map['main_name'] = $_REQUEST['main_name'];
} }
if ($_REQUEST['pay_way']) {
$data_map['pay_way'] = [$_REQUEST['type'],$_REQUEST['pay_way']];
}
//游戏充值金额 //游戏充值金额
$data = M("spend use index(pay_channel)","tab_") $data = M("spend use index(pay_channel)","tab_")
->field("SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null THEN pay_amount ELSE 0 END) as cash_amount, ->field("SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null THEN pay_amount ELSE 0 END) as cash_amount,
SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount, SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount,
0 coin_amount,0 offcial_amount,0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier, 0 coin_amount,0 offcial_amount,0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier,
payed_time,game_id,main_name,merchant_way,merchant.account") payed_time,game_id,main_name,merchant_way,merchant.account,tab_spend.pay_way")
->join("left join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id") ->join("left join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id")
->join("left join tab_payment_merchant merchant on merchant.id=tab_spend.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_spend.merchant_id")
->where(['pay_status'=>1,'tab_spend.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1]) ->where(['pay_status'=>1,'tab_spend.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1])
@ -70,7 +74,7 @@ class PayMerchantController extends ThinkController
->join("left join tab_payment_merchant merchant on merchant.id=tab_deposit.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_deposit.merchant_id")
->field("0 cash_amount,SUM(CASE WHEN merchant.id is not null and pay_source=2 and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount, ->field("0 cash_amount,SUM(CASE WHEN merchant.id is not null and pay_source=2 and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount,
SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null and pay_source=2 THEN pay_amount ELSE 0 END) as coin_amount, SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null and pay_source=2 THEN pay_amount ELSE 0 END) as coin_amount,
0 offcial_amount,0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier,payed_time,game_id,main_name,merchant_way,merchant.account") 0 offcial_amount,0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier,payed_time,game_id,main_name,merchant_way,merchant.account,tab_deposit.pay_way")
->where(['pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1]) ->where(['pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1])
->where($map) ->where($map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
@ -82,7 +86,7 @@ class PayMerchantController extends ThinkController
->join("left join tab_payment_merchant merchant on merchant.id=tab_deposit.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_deposit.merchant_id")
->field("0 cash_amount,SUM(CASE WHEN merchant.id is not null and pay_source=0 and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount, ->field("0 cash_amount,SUM(CASE WHEN merchant.id is not null and pay_source=0 and tab_test_white_list.user_id is not null THEN pay_amount ELSE 0 END) as test_amount,
0 as coin_amount,SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null and pay_source=0 THEN pay_amount ELSE 0 END) as offcial_amount, 0 as coin_amount,SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null and pay_source=0 THEN pay_amount ELSE 0 END) as offcial_amount,
0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier,payed_time,0 as game_id,main_name,merchant_way,merchant.account") 0 spread_amount,0 supersign_amount,0 test_order_amount,merchant_id,name,channel,identifier,payed_time,0 as game_id,main_name,merchant_way,merchant.account,tab_deposit.pay_way")
->where(['pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1]) ->where(['pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1])
->where($map) ->where($map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
@ -98,7 +102,7 @@ class PayMerchantController extends ThinkController
$spreadData = M("coin_pay_order","tab_") $spreadData = M("coin_pay_order","tab_")
->field("0 cash_amount,0 test_amount,0 coin_amount,0 offcial_amount, ->field("0 cash_amount,0 test_amount,0 coin_amount,0 offcial_amount,
SUM(CASE WHEN merchant.id is not null THEN pay_amount ELSE 0 END) as spread_amount,0 supersign_amount, SUM(CASE WHEN merchant.id is not null THEN pay_amount ELSE 0 END) as spread_amount,0 supersign_amount,
0 test_order_amount,merchant_id,name,channel,identifier,pay_time payed_time,0 game_id,main_name,merchant_way,merchant.account") 0 test_order_amount,merchant_id,name,channel,identifier,pay_time payed_time,0 game_id,main_name,merchant_way,merchant.account,tab_coin_pay_order.pay_way")
->join("left join tab_payment_merchant merchant on merchant.id=tab_coin_pay_order.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_coin_pay_order.merchant_id")
->where(['order_status'=>1,'tab_coin_pay_order.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1]) ->where(['order_status'=>1,'tab_coin_pay_order.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1])
->where($map) ->where($map)
@ -111,7 +115,7 @@ class PayMerchantController extends ThinkController
SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is not null THEN pay_price ELSE 0 END) as test_amount, SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is not null THEN pay_price ELSE 0 END) as test_amount,
0 coin_amount,0 offcial_amount,0 spread_amount, 0 coin_amount,0 offcial_amount,0 spread_amount,
SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null THEN pay_price ELSE 0 END) as supersign_amount, SUM(CASE WHEN merchant.id is not null and tab_test_white_list.user_id is null THEN pay_price ELSE 0 END) as supersign_amount,
0 test_order_amount,merchant_id,name,channel,identifier,pay_time payed_time,game_id,main_name,merchant_way,merchant.account") 0 test_order_amount,merchant_id,name,channel,identifier,pay_time payed_time,game_id,main_name,merchant_way,merchant.account,tab_game_supersign.pay_way")
->join("left join tab_payment_merchant merchant on merchant.id=tab_game_supersign.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_game_supersign.merchant_id")
->join("left join tab_test_white_list on tab_test_white_list.user_id=tab_game_supersign.user_id") ->join("left join tab_test_white_list on tab_test_white_list.user_id=tab_game_supersign.user_id")
->where(['pay_status'=>1,'tab_game_supersign.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1]) ->where(['pay_status'=>1,'tab_game_supersign.pay_way'=>['egt',1],'merchant.status'=>1,'merchant.type'=>1])
@ -124,7 +128,7 @@ class PayMerchantController extends ThinkController
->where(['tab_test_order.pay_way'=>['egt',1]]) ->where(['tab_test_order.pay_way'=>['egt',1]])
->field('0 cash_amount,0 test_amount,0 coin_amount,0 offcial_amount,0 spread_amount,0 supersign_amount, ->field('0 cash_amount,0 test_amount,0 coin_amount,0 offcial_amount,0 spread_amount,0 supersign_amount,
SUM(CASE WHEN merchant.id is not null THEN pay_amount ELSE 0 END) as test_order_amount,merchant_id,name, SUM(CASE WHEN merchant.id is not null THEN pay_amount ELSE 0 END) as test_order_amount,merchant_id,name,
channel,identifier,pay_time payed_time,game_id,main_name,merchant_way,merchant.account') channel,identifier,pay_time payed_time,game_id,main_name,merchant_way,merchant.account,tab_test_order.pay_way')
->join("left join tab_payment_merchant merchant on merchant.id=tab_test_order.merchant_id") ->join("left join tab_payment_merchant merchant on merchant.id=tab_test_order.merchant_id")
->where(['merchant.status'=>1,'merchant.type'=>1]) ->where(['merchant.status'=>1,'merchant.type'=>1])
->where($map) ->where($map)
@ -142,7 +146,7 @@ class PayMerchantController extends ThinkController
name,channel,identifier") name,channel,identifier")
->page($p, $row) ->page($p, $row)
->where("name is not null and merchant_way !=0") ->where("name is not null and merchant_way !=0")
// ->where($map) ->where($data_map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
->select(); ->select();
} else { } else {
@ -153,6 +157,7 @@ class PayMerchantController extends ThinkController
sum(test_order_amount) test_order_amount,merchant_id,account,merchant_way,main_name, sum(test_order_amount) test_order_amount,merchant_id,account,merchant_way,main_name,
name,channel,identifier") name,channel,identifier")
->where("name is not null and merchant_way !=0") ->where("name is not null and merchant_way !=0")
->where($data_map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
->select(); ->select();
} }
@ -160,6 +165,7 @@ class PayMerchantController extends ThinkController
$count = M()->table("({$sql})a") $count = M()->table("({$sql})a")
->field("merchant_id") ->field("merchant_id")
->where("name is not null and merchant_way !=0") ->where("name is not null and merchant_way !=0")
->where($data_map)
// ->where($map) // ->where($map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
->select(false); ->select(false);
@ -178,6 +184,7 @@ class PayMerchantController extends ThinkController
sum(spread_amount) spread_amount,sum(supersign_amount) supersign_amount, sum(spread_amount) spread_amount,sum(supersign_amount) supersign_amount,
sum(test_order_amount) test_order_amount,merchant_id") sum(test_order_amount) test_order_amount,merchant_id")
->where("name is not null and merchant_way !=0") ->where("name is not null and merchant_way !=0")
->where($data_map)
// ->where($map) // ->where($map)
->find(); ->find();
@ -197,6 +204,7 @@ class PayMerchantController extends ThinkController
->field("sum(cash_amount+test_amount+coin_amount+offcial_amount+spread_amount+supersign_amount+test_order_amount) sum_amount, ->field("sum(cash_amount+test_amount+coin_amount+offcial_amount+spread_amount+supersign_amount+test_order_amount) sum_amount,
merchant_id,name,merchant_way") merchant_id,name,merchant_way")
->where("name is not null and merchant_way !=0") ->where("name is not null and merchant_way !=0")
->where($data_map)
// ->where($map) // ->where($map)
->group("merchant_id,merchant_way") ->group("merchant_id,merchant_way")
->select(); ->select();

@ -243,8 +243,10 @@
<td><span>充值方式统计</span></td> <td><span>充值方式统计</span></td>
<td colspan="6"> <td colspan="6">
<volist name="payTypeData" id="payTypeData" key="index"> <volist name="payTypeData" id="payTypeData" key="index">
<if condition="$key neq '其他支付金额' and $payTypeData neq 0"> <if condition="$key neq '其他支付金额' and $payTypeData.amount neq 0">
{$key}{$payTypeData} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <a href="{:U('PayMerchant/index',array('pay_way'=>$payTypeData['pay_way'],'type'=>$payTypeData['type'],'timestart'=>I('timestart'),'timeend'=>I('timeend')))}">
{$key}{$payTypeData['amount']} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</a>
</if> </if>
</volist> </volist>
平台币直充总金额<span style="color: red">(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0.00</if> 平台币直充总金额<span style="color: red">(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计)</span><if condition="$coinSum neq ''">{$coinSum}<else/>0.00</if>

Loading…
Cancel
Save