支付渠道

master
chenzhi 5 years ago
parent 751357feef
commit 6c8f935170

@ -175,7 +175,7 @@ class PayChannelController extends ThinkController
$bindRechargeData['pay_amount'] = $bindRechargeData['pay_amount']?$bindRechargeData['pay_amount']:0;
$offcialData['sum'] = $offcialData['pay_amount']+$bindRechargeData['pay_amount'];
$offcialData['pay_amount'] = $offcialData['pay_amount']+$bindRechargeData['pay_amount']-$offcialData['test_coin'];
$offcialData['pay_amount'] = number_format($offcialData['pay_amount']+$bindRechargeData['pay_amount']-$offcialData['test_coin'],2,'.','');
$this->assign('offcialData',$offcialData);
@ -187,8 +187,8 @@ class PayChannelController extends ThinkController
->field("0 as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,id as test_coin")
->where($spreadMap)
->find();
$spreadData['pay_amount'] = $spreadData['pay_amount']?$spreadData['pay_amount']:0;
$spreadData['sum'] = $spreadData['pay_amount'];
$spreadData['pay_amount'] = $spreadData['pay_amount']?number_format($spreadData['pay_amount'],2,'.',''):'0.00';
$spreadData['sum'] = number_format($spreadData['pay_amount'],2,'.','');
$this->assign('spreadData',$spreadData);
@ -232,6 +232,8 @@ class PayChannelController extends ThinkController
// $channelData[$testOrderChannelData['pay_way']]['pay_amount'] = number_format($testOrderChannelData['pay_amount'],2,'.','');
$testorderChannelArr[$trkey]['pay_amount'] = number_format($testOrderChannelData['pay_amount'],2,'.','');
$testorderChannelArr[$trkey]['pay_way'] = get_pay_way($testOrderChannelData['pay_way']);
$channelData[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
$channelData[$key]['pay_way'] = get_pay_way($value['pay_way']);
}
else {
$channelData[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
@ -275,24 +277,23 @@ class PayChannelController extends ThinkController
}
//汇总计算
$sumData['pay_amount'] += $value['pay_amount'] - $value['test_coin'];
$sumData['platform_coin'] += $handleCoinData[$value['game_id']]?$handleCoinData[$value['game_id']]:0;
$sumData['test_coin'] += $handleTestData[$value['game_id']]?$handleTestData[$value['game_id']]:0;
$sumData['test_platform_coin'] +=$handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0;
$sumData['pay_amount'] += number_format($value['pay_amount'] - $value['test_coin'],2,'.','');
$sumData['platform_coin'] += $handleCoinData[$value['game_id']]?number_format($handleCoinData[$value['game_id']],2,'.',''):0;
$sumData['test_coin'] += $handleTestData[$value['game_id']]?number_format($handleTestData[$value['game_id']],2,'.',''):0;
$sumData['test_platform_coin'] +=$handleTestCoinData[$value['game_id']]?number_format($handleTestCoinData[$value['game_id']],2,'.',''):0;
}
// 汇总数据
if ($_REQUEST['game_id']) {
$sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'];
$sumData['test_coin'] = $sumData['test_coin']+$sumData['test_platform_coin'];
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
$sumData['platform_coin'] = number_format($sumData['platform_coin'] - $sumData['test_platform_coin'],2,'.','');
$sumData['test_coin'] = number_format($sumData['test_coin']+$sumData['test_platform_coin'],2,'.','');
$sumData['sum'] = number_format($sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'],2,'.','');
} else {
$sumData['pay_amount'] = $sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount'];
$sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'] +
$offcialData['pay_amount'] + $spreadData['pay_amount'];
$sumData['test_coin'] = $sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin'];
$sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'];
$coinSum = $coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost;
$sumData['pay_amount'] = number_format($sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount'],2,'.','');
$sumData['platform_coin'] = number_format($sumData['platform_coin'] - $sumData['test_platform_coin'] + $offcialData['pay_amount'] + $spreadData['pay_amount'],2,'.','');
$sumData['test_coin'] = number_format($sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin'],2,'.','');
$sumData['sum'] = number_format($sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin'],2,'.','');
$coinSum = number_format($coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost,2,'.','');
}
$sum_pay_amount = M('test_order', 'tab_')->where($maptestorder)->field('sum(pay_amount) as sum_order_amount')->find();
@ -337,7 +338,18 @@ class PayChannelController extends ThinkController
}
$payTypeDataExport['sdk_version'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计)".
($coinSum);
if ($sum_platform_pay_amount['sum_order_amount'] != 0) {
$testOrderDataExport['pay_amount'] = $sum_noplatform_pay_amount['sum_order_amount'];
}else {
$testOrderDataExport['pay_amount'] = '0.00';
}
if ($sum_noplatform_pay_amount['sum_order_amount'] != 0) {
$testOrderDataExport['platform_coin'] = $sum_platform_pay_amount['sum_order_amount'];
}else {
$testOrderDataExport['platform_coin'] = '0.00';
}
$testOrderDataExport['test_coin'] = '0.00';
$testOrderDataExport['sum'] = '0.00';
$channelDataExport['game_name'] = '支付渠道';
$channelDataExport2['game_name'] = '支付渠道占比';
foreach($channelData as $key => $value) {
@ -382,7 +394,8 @@ class PayChannelController extends ThinkController
$this->assign('listdata',$data);
//统计总额和比例
$this->assign('channelData2',$channelData);
$this->assign('sum_pay_amount',$sum_pay_amount);
$this->assign('sum_platform_pay_amount',$sum_platform_pay_amount);
$this->assign('sum_noplatform_pay_amount',$sum_noplatform_pay_amount);
$moneyAllCount = array_sum(array_column($channelData, 'pay_amount'));
$this->assign('moneyAllCount',$moneyAllCount);
$this->display();

Loading…
Cancel
Save