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

支付方式充值匹配支付渠道
master
廖金灵 5 years ago committed by Gogs
commit bee3c2728a

@ -227,30 +227,8 @@ class PayChannelController extends ThinkController
} }
$testorderChannelArr = []; $testorderChannelArr = [];
foreach($channelData as $key=>$value) { foreach($channelData as $key=>$value) {
if($testOrderChannelDatas) { $channelData[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
foreach($testOrderChannelDatas as $trkey => $testOrderChannelData) { $channelData[$key]['pay_way'] = get_pay_way($value['pay_way']);
if(intval($value['pay_way']) == intval($testOrderChannelData['pay_way'])) {
$channelData[$key]['pay_amount'] = number_format(($value['pay_amount'] + $testOrderChannelData['pay_amount']) ,2,'.','');
$channelData[$key]['pay_way'] = get_pay_way($value['pay_way']);
break;
}
else if (!in_array(intval($testOrderChannelData['pay_way']),$pay_way_arr)) {
// $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,'.','');
$channelData[$key]['pay_way'] = get_pay_way($value['pay_way']);
}
}
} else {
$channelData[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
$channelData[$key]['pay_way'] = get_pay_way($value['pay_way']);
}
if (!$value['pay_way']) { if (!$value['pay_way']) {
unset($channelData[$key]); unset($channelData[$key]);
@ -302,7 +280,7 @@ class PayChannelController extends ThinkController
$coinSum = number_format($coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost,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(); $sum_pay_amount = M('test_order', 'tab_')->where($maptestorder)->field('sum(pay_amount) as sum_order_amount')->find();
$moneyAllCount = array_sum(array_column($channelData, 'sum_order_amount')); $moneyAllCount = array_sum(array_column($channelData, 'pay_amount'));
$sumData['pay_amount'] += $sum_pay_amount["sum_order_amount"]; $sumData['pay_amount'] += $sum_pay_amount["sum_order_amount"];
$sumData['sum'] += $sum_pay_amount["sum_order_amount"]; $sumData['sum'] += $sum_pay_amount["sum_order_amount"];
if($_REQUEST['export'] == 1) { if($_REQUEST['export'] == 1) {
@ -376,7 +354,7 @@ class PayChannelController extends ThinkController
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'=>"充值-财务管理-支付渠道查看-导出"]);
//处理导出数据 //处理导出数据
data2csv(array_merge($data,[$superSignData],[$offcialData],[$spreadData],[$sumData],[$testOrder],[$payTypeDataExport],[$channelDataExport],[$channelDataExport2]),"支付渠道统计导出",array( data2csv(array_merge($data,[$superSignData],[$offcialData],[$spreadData],[$testOrder],[$sumData],[$payTypeDataExport],[$channelDataExport],[$channelDataExport2]),"支付渠道统计导出",array(
"game_name"=>"产品名称","sdk_version"=>"设备名称","pay_amount"=>"游戏现金金额","platform_coin"=>"平台币直冲金额","test_coin"=>"测试金额","sum"=>"支付渠道内合计")); "game_name"=>"产品名称","sdk_version"=>"设备名称","pay_amount"=>"游戏现金金额","platform_coin"=>"平台币直冲金额","test_coin"=>"测试金额","sum"=>"支付渠道内合计"));
} }
@ -466,6 +444,7 @@ class PayChannelController extends ThinkController
->group('pay_way') ->group('pay_way')
->select(false); ->select(false);
//超级签数据 //超级签数据
$superSignDataPay = M('game_supersign','tab_') $superSignDataPay = M('game_supersign','tab_')
->field("sum(pay_price) as pay_amount,pay_way") ->field("sum(pay_price) as pay_amount,pay_way")
@ -488,6 +467,7 @@ class PayChannelController extends ThinkController
if ($map['pay_time']) { if ($map['pay_time']) {
$map['create_time'] = $map['pay_time']; $map['create_time'] = $map['pay_time'];
$testMap['pay_time'] = $map['pay_time'];
unset($map['pay_time']); unset($map['pay_time']);
} }
//充值平台币数据 //充值平台币数据
@ -521,6 +501,7 @@ class PayChannelController extends ThinkController
$bindMap['pay_way'] = array('egt',1); $bindMap['pay_way'] = array('egt',1);
if($_REQUEST['game_id']) { if($_REQUEST['game_id']) {
$bindMap['game_id'] =$_REQUEST['game_id']; $bindMap['game_id'] =$_REQUEST['game_id'];
$testMap['game_id'] =$_REQUEST['game_id'];
} }
if ($map['pay_time']) { if ($map['pay_time']) {
$bindMap['create_time'] = $map['pay_time']; $bindMap['create_time'] = $map['pay_time'];
@ -531,11 +512,14 @@ class PayChannelController extends ThinkController
->field('sum(real_amount) as pay_amount,pay_way') ->field('sum(real_amount) as pay_amount,pay_way')
->where($bindMap) ->where($bindMap)
->select(false); ->select(false);
$testMap['pay_status'] = 1;
$testMap['pay_way'] = array('egt',1);
$testorderData = M('test_order', 'tab_')->field('sum(pay_amount) as pay_amount,pay_way')->where($testMap)->group('pay_way')->select(false);
if(!$_REQUEST['game_id']) { if(!$_REQUEST['game_id']) {
$sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData}"; $sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData} UNION ALL {$testorderData}";
} else { } else {
$sql = "{$channelData} UNION ALL {$depositData}"; $sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$testorderData}";
} }
//将语句整合起来查询 //将语句整合起来查询

Loading…
Cancel
Save