充值方式统计匹配支付渠道

master
sunke 5 years ago
parent 6cc33a7fe8
commit ce2408576c

@ -227,30 +227,8 @@ class PayChannelController extends ThinkController
}
$testorderChannelArr = [];
foreach($channelData as $key=>$value) {
if($testOrderChannelDatas) {
foreach($testOrderChannelDatas as $trkey => $testOrderChannelData) {
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']) {
unset($channelData[$key]);
@ -302,7 +280,7 @@ class PayChannelController extends ThinkController
$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();
$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['sum'] += $sum_pay_amount["sum_order_amount"];
if($_REQUEST['export'] == 1) {
@ -466,6 +444,7 @@ class PayChannelController extends ThinkController
->group('pay_way')
->select(false);
//超级签数据
$superSignDataPay = M('game_supersign','tab_')
->field("sum(pay_price) as pay_amount,pay_way")
@ -488,6 +467,7 @@ class PayChannelController extends ThinkController
if ($map['pay_time']) {
$map['create_time'] = $map['pay_time'];
$testMap['pay_time'] = $map['pay_time'];
unset($map['pay_time']);
}
//充值平台币数据
@ -521,6 +501,7 @@ class PayChannelController extends ThinkController
$bindMap['pay_way'] = array('egt',1);
if($_REQUEST['game_id']) {
$bindMap['game_id'] =$_REQUEST['game_id'];
$testMap['game_id'] =$_REQUEST['game_id'];
}
if ($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')
->where($bindMap)
->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']) {
$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 {
$sql = "{$channelData} UNION ALL {$depositData}";
$sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$testorderData}";
}
//将语句整合起来查询

Loading…
Cancel
Save