diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index cebf54414..1cf512b64 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2596,7 +2596,7 @@ class ExportController extends Controller unset($_REQUEST['merchant_id']); } - + addSubsiteWhere($map,"partner_type"); $orderData =M('test_order t', 'tab_') ->field("t.*,g.sdk_version") ->join("tab_game g on t.game_id = g.id","left") diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index e07849218..ab49ab0b6 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1325,7 +1325,9 @@ class FinanceController extends ThinkController public function payTypeStatistics() { $time = array('egt', 0);; - + if(!array_key_exists("timestart",$_REQUEST)){ + $this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d'))); + } if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) { $time = array('between', [strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399]); } elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) { @@ -1334,11 +1336,14 @@ class FinanceController extends ThinkController $time = array('elt', (strtotime($_REQUEST['timeend']) + 86399)); } // setPowerPromoteIds($map); - + $cashMap = [ + 'pay_status' => 1,'pay_way'=>['egt',1],'payed_time'=>$time + ]; + D("Spend")->addSubsiteWhere($cashMap); //获取现金充值 - $cashStatistics = SM('spend', 'tab_') + $cashStatistics = M('spend', 'tab_') ->field('pay_way,"" as pay_type,SUM(pay_amount) AS pay_amount') - ->where(['pay_status' => 1,'pay_way'=>['egt',1],'payed_time'=>$time]) + ->where($cashMap) ->group('pay_way') ->select(); foreach ($cashStatistics as $key => $value) { @@ -1348,12 +1353,14 @@ class FinanceController extends ThinkController $cashStatistics = array_column($cashStatistics, null, 'pay_way'); // dd($cashStatistics); //获取平台币充值 - $deposit = SM('deposit', 'tab_')->where([ + $depositMap = [ 'pay_source' => 2, 'tab_deposit.pay_status' => 1, 'tab_deposit.pay_way' => ['gt', 0], 'tab_deposit.payed_time'=>$time, - ])->field('tab_deposit.pay_way,"" as pay_type, SUM(tab_deposit.pay_amount) AS balance') + ]; + D("Deposit")->addSubsiteWhere($depositMap,"tab_deposit"); + $deposit = M('deposit', 'tab_')->where($depositMap)->field('tab_deposit.pay_way,"" as pay_type, SUM(tab_deposit.pay_amount) AS balance') ->group('tab_deposit.pay_way') ->select(); foreach ($deposit as $key => $value) { @@ -1435,18 +1442,16 @@ class FinanceController extends ThinkController $cashStatistics[$value['pay_way']]['balance'] += $value['pay_amount'];//别表的平台币充值 } //官网充值 - $offcialmap['pay_status'] = 1; - $offcialmap['pay_way'] = array('egt',1); - $offcialmap['pay_source'] = 0; - - $offcialData = SM('deposit','tab_') + $offcialmap = [ + 'pay_status'=>1, + 'pay_way'=>['egt',1], + 'pay_source'=>0, + 'payed_time'=>$time + ]; + D("Deposit")->addSubsiteWhere($offcialmap); + $offcialData = M('deposit','tab_') ->field("pay_way,'' as pay_type,sum(pay_amount) as pay_amount") - ->where([ - 'pay_status'=>1, - 'pay_way'=>['egt',1], - 'pay_source'=>0, - 'payed_time'=>$time - ]) + ->where($offcialmap) ->group('pay_way') ->select(); @@ -1464,12 +1469,13 @@ class FinanceController extends ThinkController } $cashStatistics[$value['pay_way']]['balance'] += $value['pay_amount'];//别表的平台币充值 } - + $testOrderMap = [ + 'pay_way'=>['egt',1], + 'pay_time'=>$time + ]; + addSubsiteWhere($testOrderMap,"partner_type"); $testOrderData = M('test_order', 'tab_') - ->where([ - 'pay_way'=>['egt',1], - 'pay_time'=>$time - ]) + ->where($testOrderMap) ->field('pay_way,sum(pay_amount) as pay_amount') ->group("pay_way") ->select(); diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index aa9aea837..a3efef00e 100644 --- a/Application/Admin/Controller/PayChannelController.class.php +++ b/Application/Admin/Controller/PayChannelController.class.php @@ -808,6 +808,9 @@ class PayChannelController extends ThinkController $_REQUEST['game_id']?$coinMap['game_id'] = $_REQUEST['game_id']:false; $map['pay_status'] = 1; + D("Spend")->addSubsiteWhere($map); + D("Deposit")->addSubsiteWhere($coinMap,"tab_deposit"); + D("Deposit")->addSubsiteWhere($offcialmap); // setPowerPromoteIds($map,'promote_id'); // setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); @@ -1034,6 +1037,7 @@ class PayChannelController extends ThinkController if ($_REQUEST['game_id']) { $map['game_id'] = $_REQUEST['game_id']; } + D("Spend")->addSubsiteWhere($map,"tab_spend"); // setPowerPromoteIds($map,'promote_id'); $data = M('spend','tab_') ->field("pay_order_number,order_number,tab_spend.user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status,sdk_version") @@ -1048,6 +1052,8 @@ class PayChannelController extends ThinkController $map['user_account'] = $map['tab_spend.user_account']; unset($map['tab_spend.user_account']); + + $coinMap = $map; $map['tab_spend.user_account'] = array('like',"{$_REQUEST['user_account']}%"); $coinMap['tab_deposit.pay_status'] = 1; @@ -1055,6 +1061,9 @@ class PayChannelController extends ThinkController $coinMap['tab_deposit.user_account'] = $coinMap['user_account']; unset($coinMap['user_account']); + if(isset($coinMap['tab_spend.partner_type'])) unset($coinMap['tab_spend.partner_type']); + D("Deposit")->addSubsiteWhere($coinMap,"tab_deposit"); + if(!$coinMap['tab_deposit.user_account']) { unset($coinMap['tab_deposit.user_account']); } @@ -1224,6 +1233,7 @@ class PayChannelController extends ThinkController // unset($map['pay_time']); // } // setPowerPromoteIds($map,'tab_deposit.promote_id'); + D("Deposit")->addSubsiteWhere($map,"tab_deposit"); $data = M('deposit','tab_') ->field("pay_order_number,order_number,user_account,create_time as pay_time,pay_amount as cost,pay_amount,pay_way as pay_type,pay_way") ->join('inner join tab_test_white_list on tab_deposit.user_id=tab_test_white_list.user_id') @@ -1413,6 +1423,7 @@ class PayChannelController extends ThinkController if ($_REQUEST['game_id']) { $map['game_id'] = $_REQUEST['game_id']; } + D("Spend")->addSubsiteWhere($map,"tab_spend"); // setPowerPromoteIds($map,'promote_id'); $data = M('spend','tab_') @@ -1440,6 +1451,9 @@ class PayChannelController extends ThinkController $coinMap['tab_deposit.user_account'] = $coinMap['user_account']; unset($coinMap['user_account']); + if(isset($coinMap['tab_spend.partner_type'])) unset($coinMap['tab_spend.partner_type']); + D("Deposit")->addSubsiteWhere($coinMap,"tab_deposit"); + if(!$coinMap['tab_deposit.user_account']) { unset($coinMap['tab_deposit.user_account']); } @@ -1635,6 +1649,7 @@ class PayChannelController extends ThinkController fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 $map['pay_source'] = 0; + D("Deposit")->addSubsiteWhere($map,"tab_deposit"); if ($map['pay_time']) { $map['create_time'] = $map['pay_time']; unset($map['pay_time']); diff --git a/Application/Admin/Controller/TestOrderController.class.php b/Application/Admin/Controller/TestOrderController.class.php index 6ac73b078..e6cb886ea 100644 --- a/Application/Admin/Controller/TestOrderController.class.php +++ b/Application/Admin/Controller/TestOrderController.class.php @@ -63,6 +63,7 @@ class TestOrderController extends ThinkController $map['merchant_id'] = $_REQUEST['merchant_id']; unset($_REQUEST['merchant_id']); } + addSubsiteWhere($map,"partner_type"); $order_list = M('test_order t', 'tab_') ->field("t.*,g.sdk_version") ->join("tab_game g on t.game_id = g.id","left") diff --git a/Application/Admin/View/Finance/payTypeStatistics.html b/Application/Admin/View/Finance/payTypeStatistics.html index 0febbec2f..739b8dfe4 100644 --- a/Application/Admin/View/Finance/payTypeStatistics.html +++ b/Application/Admin/View/Finance/payTypeStatistics.html @@ -76,8 +76,9 @@
游戏充值统计 充值方式统计 - 支付商户统计 - + + 支付商户统计 +