支付渠道统计-首页 名称优化

master
chenzhi 5 years ago
parent cc966711d1
commit 6d3f1b67e2

@ -59,7 +59,7 @@ class PayChannelController extends ThinkController
//游戏币计算 //游戏币计算
$data = M('spend use index(pay_channel)','tab_') $data = M('spend use index(pay_channel)','tab_')
->field("game_name,sum(pay_amount) as pay_amount,game_id") ->field("game_name,sum(pay_amount) as pay_amount,game_id,sdk_version")
->where($map) ->where($map)
->group('game_id') ->group('game_id')
->order('pay_amount desc') ->order('pay_amount desc')
@ -73,7 +73,7 @@ class PayChannelController extends ThinkController
$coinData = M('pay_info','tab_') $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_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") ->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,tab_pay_info.sdk_version")
->where($coinMap) ->where($coinMap)
->group("game_id") ->group("game_id")
->select(); ->select();
@ -125,7 +125,8 @@ class PayChannelController extends ThinkController
$data[$key]['platform_coin'] = $handleCoinData[$value['game_id']]?$handleCoinData[$value['game_id']]:0; $data[$key]['platform_coin'] = $handleCoinData[$value['game_id']]?$handleCoinData[$value['game_id']]:0;
$data[$key]['test_coin'] = $handleTestData[$value['game_id']]?$handleTestData[$value['game_id']]:0; $data[$key]['test_coin'] = $handleTestData[$value['game_id']]?$handleTestData[$value['game_id']]:0;
$data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0; $data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0;
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果";
} }
$superMap = $map; $superMap = $map;
// unset($superMap['promote_id']); // unset($superMap['promote_id']);
@ -253,7 +254,7 @@ class PayChannelController extends ThinkController
$this->assign('_page', $page); $this->assign('_page', $page);
} }
$sumData['game'] = '汇总'; $sumData['game_name'] = '汇总';
$sumData['pay_amount'] = 0; $sumData['pay_amount'] = 0;
$sumData['platform_coin'] = 0; $sumData['platform_coin'] = 0;
$sumData['test_coin'] = 0; $sumData['test_coin'] = 0;
@ -291,37 +292,58 @@ class PayChannelController extends ThinkController
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin']; $sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
$coinSum = $coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost; $coinSum = $coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost;
} }
$sum_pay_amount = M('test_order', 'tab_')->where($maptestorder)->field('sum(pay_amount) as sum_order_amount')->find();
$moneyAllCount = array_sum(array_column($channelData, 'pay_amount'));
if($_REQUEST['export'] == 1) { if($_REQUEST['export'] == 1) {
$title = array('产品名称','游戏现金金额','平台币直冲金额','测试金额','支付渠道内合计'); $title = array('产品名称','游戏现金金额','平台币直冲金额','测试金额','支付渠道内合计');
$superSignData['game_name'] = '超级签'; $superSignData['game_name'] = '超级签';
$superSignData['platform_coin'] = '0';
$superSignData['sdk_version'] = '';
$offcialData['game_name'] = '官网'; $offcialData['game_name'] = '官网';
$spreadData['game_name'] = '推广后台'; $offcialData['platform_coin'] = $offcialData['pay_amount'];
$offcialData['pay_amount'] = "0";
$offcialData['sdk_version'] = "";
$superSignData['platform_coin'] = '0';
$offcialData['platform_coin'] = '0'; $spreadData['game_name'] = '推广后台';
$spreadData['platform_coin'] = '0'; $spreadData['platform_coin'] = $spreadData['pay_amount'];
$spreadData['pay_amount'] = '0';
$spreadData['test_coin'] = '0'; $spreadData['test_coin'] = '0';
$spreadData['sdk_version'] = '';
$sumData['sdk_version'] = '';
$testOrder["game_name"] = "测试环境内外网平台";
$testOrder["sdk_version"] = "";
$testOrder["pay_amount"] =$sum_pay_amount['sum_order_amount'] ?: "0";
$testOrder["platform_coin"] ="0";
$testOrder['test_coin'] = '0';
$testOrder['sum'] = $sum_pay_amount['sum_order_amount'] ?: "0";
//充值方式统计 //充值方式统计
$payTypeDataExport['game_name'] = '充值方式统计'; $payTypeDataExport['game_name'] = '充值方式统计';
foreach($payTypeData as $key => $value) { foreach($payTypeData as $key => $value) {
if ($value) { if ($value) {
$payTypeDataExport['pay_amount'] .= $key.''.$value." "; $payTypeDataExport['sdk_version'] .= $key.''.$value." ";
} }
} }
$payTypeDataExport['pay_amount'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)". $payTypeDataExport['sdk_version'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)".
($coinSum); ($coinSum);
$channelDataExport['game_name'] = '支付渠道'; $channelDataExport['game_name'] = '支付渠道';
$channelDataExport2['game_name'] = '支付渠道占比';
foreach($channelData as $key => $value) { foreach($channelData as $key => $value) {
if ($value) { if ($value) {
$channelDataExport['pay_amount'] .= $value['pay_way'].''.$value['pay_amount']." "; $channelDataExport['sdk_version'] .= $value['pay_way'].''.$value['pay_amount']." ";
$channelDataExport2['sdk_version'] .= $value['pay_way'].''.round($value['pay_amount']*100/ $moneyAllCount,2)."% ";
} }
} }
unset($sumData['test_platform_coin']); unset($sumData['test_platform_coin']);
if ($_REQUEST['game_id']) { if ($_REQUEST['game_id']) {
@ -333,10 +355,9 @@ class PayChannelController extends ThinkController
$GetData = $_GET; $GetData = $_GET;
unset($GetData['export']); unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-支付渠道查看-导出"]); addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U(CONTROLLER_NAME.'/'.ACTION_NAME,$GetData),'menu'=>"充值-财务管理-支付渠道查看-导出"]);
//处理导出数据
db2csv(array_merge(array_merge(array_merge(array_merge( data2csv(array_merge($data,[$superSignData],[$offcialData],[$spreadData],[$sumData],[$testOrder],[$payTypeDataExport],[$channelDataExport],[$channelDataExport2]),"支付渠道统计导出",array(
array_merge(array_merge( "game_name"=>"产品名称","sdk_version"=>"设备名称","pay_amount"=>"游戏现金金额","platform_coin"=>"平台币直冲金额","test_coin"=>"测试金额","sum"=>"支付渠道内合计"));
array_merge($data,[0=>$superSignData]),[0=>$offcialData])),[0=>$spreadData],[0=>$sumData])),[0=>$payTypeDataExport]),[0=>$channelDataExport]),'支付渠道统计导出',$title);
} }
@ -348,15 +369,15 @@ class PayChannelController extends ThinkController
$this->meta_title = "支付渠道统计"; $this->meta_title = "支付渠道统计";
$size = $row;//每页显示的记录数 $size = $row;//每页显示的记录数
$data = array_slice($data, ($arraypage - 1) * $size, $size); $data = array_slice($data, ($arraypage - 1) * $size, $size);
$sum_pay_amount = M('test_order', 'tab_')->where($maptestorder)->field('sum(pay_amount) as sum_order_amount')->find();
//平台币直充金额,下面列表 //平台币直充金额,下面列表
$this->assign('coinSum',$coinSum); $this->assign('coinSum',$coinSum);
$channelData2 = $channelData; $channelData2 = $channelData;
$arr_merge = array_merge($channelData2,$testorderChannelArr); $arr_merge = array_merge($channelData2,$testorderChannelArr);
$this->assign('sumData',$sumData); $this->assign('sumData',$sumData);
$this->assign('channelData',$arr_merge); $this->assign('channelData',$arr_merge);
$this->assign('listdata',$data); $this->assign('listdata',$data);
//统计总额和比例 //统计总额和比例
$this->assign('channelData2',$channelData); $this->assign('channelData2',$channelData);
$this->assign('sum_pay_amount',$sum_pay_amount); $this->assign('sum_pay_amount',$sum_pay_amount);

@ -137,6 +137,7 @@
<tr> <tr>
<th ><div class="tooltip">产品名称<span class="tooltiptext"><span style="margin-left: -10px">平台官网,超级签,游戏等等产品</span></span></div></th> <th ><div class="tooltip">产品名称<span class="tooltiptext"><span style="margin-left: -10px">平台官网,超级签,游戏等等产品</span></span></div></th>
<th ><div class="tooltip">设备名称<span class="tooltiptext"><span style="margin-left: -10px">游戏的设备名称</span></span></div></th>
<th ><div class="tooltip">游戏现金金额<span class="tooltiptext"><span style="margin-left: -10px">第三方支付充值到游戏的金额</span></span></div></th> <th ><div class="tooltip">游戏现金金额<span class="tooltiptext"><span style="margin-left: -10px">第三方支付充值到游戏的金额</span></span></div></th>
@ -165,6 +166,7 @@
<volist name="listdata" id="data"> <volist name="listdata" id="data">
<tr> <tr>
<td >{$data.game_name}</td> <td >{$data.game_name}</td>
<td >{$data.sdk_version}</td>
<td> <td>
<!-- onclick="showWindow({$data.game_id})"--> <!-- onclick="showWindow({$data.game_id})"-->
{$data['pay_amount']}</td> {$data['pay_amount']}</td>
@ -179,6 +181,7 @@
<if condition="$_GET['game_id'] eq ''"> <if condition="$_GET['game_id'] eq ''">
<tr> <tr>
<td><span>超级签</span></td> <td><span>超级签</span></td>
<td></td>
<td ><span><if condition="$superSignData.pay_amount neq ''">{$superSignData['pay_amount']}<else/>0.00</if></span></td> <td ><span><if condition="$superSignData.pay_amount neq ''">{$superSignData['pay_amount']}<else/>0.00</if></span></td>
<td>0.00</td> <td>0.00</td>
<td><span><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$superSignData.test_coin neq ''">{$superSignData.test_coin}<else/>0.00</if></a></span></td> <td><span><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'game_supersign','game_name'=>'超级签'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$superSignData.test_coin neq ''">{$superSignData.test_coin}<else/>0.00</if></a></span></td>
@ -189,6 +192,7 @@
</tr> </tr>
<tr> <tr>
<td><span>官网</span></td> <td><span>官网</span></td>
<td></td>
<td >0.00</td> <td >0.00</td>
<td>{$offcialData['pay_amount']}</td> <td>{$offcialData['pay_amount']}</td>
<td><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$offcialData.test_coin neq ''">{$offcialData.test_coin}<else/>0.00</if></a></td> <td><a href="{:U('PayChannel/testDetail',array_merge(array('model'=>'deposit','game_name'=>'官网'),I('get.'),['p'=>1]))}" style="display:block;"><if condition="$offcialData.test_coin neq ''">{$offcialData.test_coin}<else/>0.00</if></a></td>
@ -199,6 +203,7 @@
</tr> </tr>
<tr> <tr>
<td><span>推广后台</span></td> <td><span>推广后台</span></td>
<td></td>
<td ><span>0.00</span></td> <td ><span>0.00</span></td>
<td>{$spreadData['pay_amount']}</td> <td>{$spreadData['pay_amount']}</td>
<td>0.00</td> <td>0.00</td>
@ -210,6 +215,7 @@
</if> </if>
<tr> <tr>
<td><span>汇总</span></td> <td><span>汇总</span></td>
<td></td>
<td ><span><if condition="$sumData.pay_amount neq ''">{$sumData['pay_amount']}<else/>0.00</if></span></td> <td ><span><if condition="$sumData.pay_amount neq ''">{$sumData['pay_amount']}<else/>0.00</if></span></td>
<td><span><if condition="$sumData.platform_coin neq ''">{$sumData['platform_coin']}<else/>0.00</if></span></td> <td><span><if condition="$sumData.platform_coin neq ''">{$sumData['platform_coin']}<else/>0.00</if></span></td>
<td>{$sumData['test_coin']}</td> <td>{$sumData['test_coin']}</td>
@ -220,6 +226,7 @@
</tr> </tr>
<tr> <tr>
<td><span>测试环境内外网平台</span></td> <td><span>测试环境内外网平台</span></td>
<td></td>
<td ><span><if condition="$sum_pay_amount.sum_order_amount neq ''">{$sum_pay_amount['sum_order_amount']}<else/>0.00</if></span></td> <td ><span><if condition="$sum_pay_amount.sum_order_amount neq ''">{$sum_pay_amount['sum_order_amount']}<else/>0.00</if></span></td>
<td><span>0.00</span></td> <td><span>0.00</span></td>
<td>0.00</td> <td>0.00</td>
@ -231,7 +238,7 @@
</notemtpy> </notemtpy>
<tr> <tr>
<td><span>充值方式统计</span></td> <td><span>充值方式统计</span></td>
<td colspan="5"> <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 neq 0">
{$key}{$payTypeData} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp {$key}{$payTypeData} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
@ -242,7 +249,7 @@
</tr> </tr>
<tr> <tr>
<td><span>支付渠道</span></td> <td><span>支付渠道</span></td>
<td colspan="5"> <td colspan="6">
<volist name="channelData" id="channelData"> <volist name="channelData" id="channelData">
{$channelData.pay_way}{$channelData.pay_amount} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp {$channelData.pay_way}{$channelData.pay_amount} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</volist> </volist>
@ -250,7 +257,7 @@
</tr> </tr>
<tr> <tr>
<td><span>支付渠道占比</span></td> <td><span>支付渠道占比</span></td>
<td colspan="5"> <td colspan="6">
<volist name="channelData2" id="channel"> <volist name="channelData2" id="channel">
{$channel.pay_way}: {$channel.pay_way}:
<php> <php>

Loading…
Cancel
Save