diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index aed71247f..88e78320a 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -1001,11 +1001,12 @@ class FinanceController extends ThinkController } elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) { $time = array('elt', (strtotime($_REQUEST['timeend']) + 86399)); } + setPowerPromoteIds($map); //获取现金充值 $cashStatistics = M('spend', 'tab_') ->field('pay_way,"" as pay_type,SUM(pay_amount) AS pay_amount') - ->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time]) + ->where(['pay_status' => 1,'pay_way'=>['egt',1],'pay_time'=>$time,'promote_id'=>$map['promote_id']]) ->group('pay_way') ->select(); foreach ($cashStatistics as $key => $value) { @@ -1020,7 +1021,8 @@ class FinanceController extends ThinkController 'tab_deposit.pay_status' => 1, 'tab_deposit.pay_way' => ['gt', 0], 'extend'=>['eq',''] - ,'tab_deposit.create_time'=>$time + ,'tab_deposit.create_time'=>$time, + 'tab_deposit.promote_id'=>$map['promote_id'] ])->field('tab_deposit.pay_way,"" as pay_type, SUM(tab_deposit.pay_amount) AS balance') ->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number") ->group('tab_deposit.pay_way') @@ -1059,7 +1061,8 @@ class FinanceController extends ThinkController ->where([ 'pay_status' => 1, 'pay_way' => ['gt', 0], - 'create_time'=>$time + 'create_time'=>$time, + 'promote_id'=>$map['promote_id'] ]) ->group('pay_way') ->select(); @@ -1084,7 +1087,8 @@ class FinanceController extends ThinkController ->field("pay_way,'' as pay_type,sum(real_amount) as pay_amount") ->where([ 'order_status'=>['egt',1], - 'pay_way'=>['egt',1],'pay_time'=>$time + 'pay_way'=>['egt',1],'pay_time'=>$time, + 'promote_id'=>$map['promote_id'] ]) ->group('pay_way') ->select(); @@ -1114,7 +1118,8 @@ class FinanceController extends ThinkController 'pay_status'=>1, 'pay_way'=>['egt',1], 'pay_source'=>0, - 'create_time'=>$time + 'create_time'=>$time, + 'promote_id'=>$map['promote_id'] ]) ->group('pay_way') ->select(); diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index 788365aea..c55501b9f 100644 --- a/Application/Admin/Controller/PayChannelController.class.php +++ b/Application/Admin/Controller/PayChannelController.class.php @@ -50,6 +50,9 @@ class PayChannelController extends ThinkController $map['pay_status'] = $coinMap['pay_status'] = 1; $map['pay_way'] = array('egt',1); + + setPowerPromoteIds($map,'promote_id'); + //游戏币计算 $data = M('spend','tab_') ->field("game_name,sum(pay_amount) as pay_amount,game_id") @@ -61,6 +64,8 @@ class PayChannelController extends ThinkController //平台币充值金额计算 $coinMap['pay_source'] = 2; $coinMap['extend'] = array('eq',''); + setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); + $coinData = M('pay_info','tab_') ->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") @@ -118,15 +123,16 @@ class PayChannelController extends ThinkController $data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0; } - + $superMap = $map; + unset($superMap['promote_id']); //超级签数据 $superSignData = M('game_supersign','tab_') ->field("0 as game_name,sum(pay_price) as pay_amount,0 as platform_coin,0 as test_coin") - ->where($map) + ->where($superMap) ->find(); $testSuperSignCost = M('game_supersign','tab_') ->join("inner join tab_test_white_list on tab_game_supersign.user_id=tab_test_white_list.user_id") - ->where($map) + ->where($superMap) ->sum('pay_price'); $superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0; $superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0; @@ -137,6 +143,7 @@ class PayChannelController extends ThinkController $offcialmap['pay_status'] = 1; $offcialmap['pay_way'] = array('egt',1); $offcialmap['pay_source'] = 0; + setPowerPromoteIds($offcialmap,'promote_id'); $offcialData = M('deposit','tab_') ->field("id as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,0 as test_coin") @@ -151,6 +158,7 @@ class PayChannelController extends ThinkController $bindMap['pay_status'] = 1; $bindMap['pay_way'] = array('egt',1); + setPowerPromoteIds($bindMap,'promote_id'); $bindRechargeData = M('bind_recharge','tab_') ->field('sum(real_amount) as pay_amount') @@ -165,6 +173,7 @@ class PayChannelController extends ThinkController $spreadMap['order_status'] = array('egt',1); $spreadMap['pay_way'] = array('egt',1); + setPowerPromoteIds($spreadMap,'promote_id'); //推广后台 $spreadData = M("coin_pay_order","tab_") ->field("0 as game_name,sum(real_amount) as pay_amount,0 as platform_coin,id as test_coin") @@ -343,11 +352,13 @@ class PayChannelController extends ThinkController if($map['pay_time']) { $spreadMap['create_time'] = $map['pay_time']; } + $spreadMap['promote_id'] = $map['promote_id']; //推广后台 $spreadDataPay = M("coin_pay_order","tab_") ->field("sum(pay_amount) as pay_amount,pay_way") ->where($spreadMap) ->select(false); + if ($map['pay_time']) { $map['create_time'] = $map['pay_time']; unset($map['pay_time']); @@ -367,6 +378,7 @@ class PayChannelController extends ThinkController if ($map['pay_time']) { $bindMap['create_time'] = $map['pay_time']; } + $bindMap['promote_id'] = $map['promote_id']; $bindRechargeData = M('bind_recharge','tab_') ->field('sum(real_amount) as pay_amount,pay_way') @@ -439,6 +451,9 @@ class PayChannelController extends ThinkController $page = $p ? $p : 1; //默认显示第一页数据 + setPowerPromoteIds($map,'promote_id'); + setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); + $spendData = M('spend','tab_') ->field("pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_name,cost,pay_amount,pay_way") ->where($map) @@ -454,6 +469,7 @@ class PayChannelController extends ThinkController ->select(false); $spreadMap['order_status'] = array('egt',1); + setPowerPromoteIds($spreadMap,'promote_id'); // $spreadMap['pay_way'] = array('egt',1); $coin_pay_order = M('coin_pay_order','tab_') ->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way") @@ -463,6 +479,7 @@ class PayChannelController extends ThinkController //官网数据 $offcialmap['pay_status'] = 1; $offcialmap['pay_source'] = 0; + setPowerPromoteIds($offcialmap,'promote_id'); $offcialData = M('deposit','tab_') ->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way") @@ -478,6 +495,7 @@ class PayChannelController extends ThinkController unset($map['pay_order_number']); } + unset($map['promote_id']); //超级签数据 $superSignData = M('game_supersign','tab_') ->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way") @@ -601,8 +619,9 @@ class PayChannelController extends ThinkController $_REQUEST['game_id']?$map['game_id'] = $_REQUEST['game_id']:false; $_REQUEST['game_id']?$coinMap['game_id'] = $_REQUEST['game_id']:false; - $map['pay_status'] = 1; + setPowerPromoteIds($map,'promote_id'); + setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); // $_REQUEST['model']?$model= $_REQUEST['model']:false; if ($_REQUEST['model']) { @@ -624,6 +643,7 @@ class PayChannelController extends ThinkController ->select(false); $spreadMap['order_status'] = array('egt',1); + setPowerPromoteIds($spreadMap,'promote_id'); $coin_pay_order = M('coin_pay_order','tab_') ->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way") @@ -633,6 +653,7 @@ class PayChannelController extends ThinkController //官网数据 $offcialmap['pay_status'] = 1; $offcialmap['pay_source'] = 0; + setPowerPromoteIds($offcialmap,'promote_id'); $offcialData = M('deposit','tab_') ->field("pay_order_number,create_time as pay_time,user_account,promote_account,pay_ip as spend_ip,pay_amount as cost,pay_amount,pay_way") @@ -648,6 +669,7 @@ class PayChannelController extends ThinkController unset($map['pay_order_number']); } + unset($map['promote_id']); //超级签数据 $superSignData = M('game_supersign','tab_') ->field("order_id as pay_order_number,pay_time,tab_user.account as user_account,tab_user.promote_account,pay_price as cost,pay_price as pay_amount,pay_way") @@ -798,7 +820,7 @@ class PayChannelController extends ThinkController if ($_REQUEST['game_id']) { $map['game_id'] = $_REQUEST['game_id']; } - + setPowerPromoteIds($map,'promote_id'); $data = M('spend','tab_') ->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status") ->join('inner join tab_test_white_list on tab_spend.user_id=tab_test_white_list.user_id') @@ -813,6 +835,8 @@ class PayChannelController extends ThinkController $coinMap = $map; $coinMap['tab_deposit.create_time'] = $map['pay_time']; unset($coinMap['pay_time']); + unset($coinMap['promote_id']); + setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); $coinData = M('pay_info','tab_') ->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number") @@ -939,6 +963,7 @@ class PayChannelController extends ThinkController $map['create_time'] = $map['pay_time']; unset($map['pay_time']); } + setPowerPromoteIds($map,'tab_deposit.promote_id'); $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') @@ -1098,6 +1123,7 @@ class PayChannelController extends ThinkController if ($_REQUEST['game_id']) { $map['game_id'] = $_REQUEST['game_id']; } + setPowerPromoteIds($map,'promote_id'); $data = M('spend','tab_') ->field("pay_order_number,order_number,user_account,pay_time,game_name,server_name,game_player_name,cost,pay_amount,pay_way as pay_type,pay_way,pay_game_status") @@ -1114,6 +1140,9 @@ class PayChannelController extends ThinkController $coinMap = $map; $coinMap['tab_deposit.create_time'] = $map['pay_time']; unset($coinMap['pay_time']); + unset($coinMap['promote_id']); + setPowerPromoteIds($coinMap,'tab_deposit.promote_id'); + $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_test_white_list on tab_test_white_list.user_id=tab_pay_info.user_id") @@ -1283,6 +1312,7 @@ class PayChannelController extends ThinkController $map['create_time'] = $map['pay_time']; unset($map['pay_time']); } + setPowerPromoteIds($map,'tab_deposit.promote_id'); $accessNum = 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") @@ -1446,5 +1476,17 @@ class PayChannelController extends ThinkController fputcsv($fp, $sumDataPay); } + function getGameList() { + + if (I('partner_id')) { + $map['partner_id'] = I('partner_id'); + } + if (I('sdk_type')) { + $map['sdk_version'] = I('sdk_type'); + } + $data = M('game','tab_')->field("id,game_name")->where($map)->select(); + + $this->ajaxReturn($data,'json'); + } } \ No newline at end of file diff --git a/Application/Admin/View/PayChannel/index.html b/Application/Admin/View/PayChannel/index.html index 5cf4f38dd..72c615be5 100644 --- a/Application/Admin/View/PayChannel/index.html +++ b/Application/Admin/View/PayChannel/index.html @@ -101,13 +101,11 @@