diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 4b85bbb1f..899ff82ec 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1748,7 +1748,8 @@ function data2csv(&$data,$title,$fields){ foreach ($data as $row) { $a = []; foreach($field as $k=>$v){ - $a[$v] = $row[$v] . "\t";//防止格式错误 + // $a[$v] = $row[$v] . "\t";//防止格式错误 + $a[$v] = $row[$v]; } if ($index == 10000) { //每次写入1000条数据清除内存 $index = 0; diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index aed71247f..fe12aeb59 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -759,7 +759,7 @@ class FinanceController extends ThinkController } public function gameStatisticsDetail($p = 1) { - set_time_limit(0); + if (isset($_REQUEST['pay_way'])) { $map['pay_way'] = $_REQUEST['pay_way']; @@ -831,6 +831,7 @@ class FinanceController extends ThinkController $order = "pay_time DESC"; $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); + foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); } @@ -847,16 +848,15 @@ class FinanceController extends ThinkController $this->assign('sumInside', $sumInside); $this->assign('sumAll', null_to_0($sumAll)); - $count = D("spend")->getSpendData($map,$field,$group,$order); + $count = D("spend")->getSpendData($map,'count(*) as count',$group,$order); - $count = count($count); + $count = $count[0]['count']; $page = set_pagination($count,$row); if($page) {$this->assign('_page', $page);} $this->meta_title = '游戏订单查看'; $this->assign('data',$data); - $from = I('from', ''); - $this->display($from); + $this->display(); } public function coinDetail($p = 1) { @@ -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/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 27f5c6275..f15aef2c0 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -121,7 +121,7 @@ class FinancePromoteController extends AdminController } private function getJoinPromoteData($map,$istimeselect,$type="spend") { - setPowerPromoteIds($map,"s.promote_id"); + // setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; @@ -277,7 +277,7 @@ class FinancePromoteController extends AdminController } private function promoteUserData($map,$istimeselect,$type="spend") { - setPowerPromoteIds($map,"s.promote_id"); + // setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index 788365aea..6a87672a9 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') @@ -811,8 +833,12 @@ class PayChannelController extends ThinkController } $coinMap = $map; - $coinMap['tab_deposit.create_time'] = $map['pay_time']; - unset($coinMap['pay_time']); + if ($map['pay_time']) { + $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") @@ -822,6 +848,7 @@ class PayChannelController extends ThinkController tab_deposit.pay_amount,tab_deposit.pay_way as pay_type,tab_deposit.pay_way,'' as pay_game_status") ->where($coinMap) ->select(false); + $page = ($page-1) * $row; $count = "select count(*) as count from ({$data} UNION ALL {$coinData})t;"; @@ -939,6 +966,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 +1126,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") @@ -1112,8 +1141,14 @@ class PayChannelController extends ThinkController $coinMap = $map; - $coinMap['tab_deposit.create_time'] = $map['pay_time']; - unset($coinMap['pay_time']); + if($map['pay_time']) { + $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 +1318,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 +1482,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/Finance/coinDetail.html b/Application/Admin/View/Finance/coinDetail.html index ce9338edc..1f4c58998 100644 --- a/Application/Admin/View/Finance/coinDetail.html +++ b/Application/Admin/View/Finance/coinDetail.html @@ -15,6 +15,7 @@ @@ -91,9 +93,10 @@
@@ -253,9 +256,11 @@ Think.setValue('{$key}',"{$vo}"); + $(".select_gallery").select2(); diff --git a/Application/Admin/View/Finance/gameStatisticsDetail.html b/Application/Admin/View/Finance/gameStatisticsDetail.html index 400e00d37..dedd6862e 100644 --- a/Application/Admin/View/Finance/gameStatisticsDetail.html +++ b/Application/Admin/View/Finance/gameStatisticsDetail.html @@ -41,7 +41,7 @@
- 返回 + 返回
diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html index e4351eab5..8435ed9a7 100644 --- a/Application/Admin/View/FinancePromote/gameStatistics.html +++ b/Application/Admin/View/FinancePromote/gameStatistics.html @@ -95,6 +95,9 @@
+
+ 返回 +
+ + +
搜索 diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index 8fd8b2d59..25314ddd0 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -222,9 +222,9 @@ 游戏查看 + href="{:U('FinancePromote/gameStatistics',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id'],'promote_type'=>1],I('get.'),['p'=>1]))}">游戏查看 渠道查看 + href="{:U('FinancePromote/promoteUser',array_merge(['promote_id'=>$data['p_id'],'company_id'=>$data['company_id']],I('get.'),['p'=>1]))}">渠道查看 diff --git a/Application/Admin/View/FinancePromote/promoteUser.html b/Application/Admin/View/FinancePromote/promoteUser.html index c65fbd042..670441488 100644 --- a/Application/Admin/View/FinancePromote/promoteUser.html +++ b/Application/Admin/View/FinancePromote/promoteUser.html @@ -87,6 +87,9 @@
+
+ 返回 +
@@ -209,7 +212,7 @@ - 游戏查看 + 游戏查看 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 @@
- +
+
- @@ -280,6 +278,28 @@ }); } + function get_game_list() + { + var game_name = "{:I('game_id')}"; + $.ajax({ + url:"{:U('PayChannel/getGameList')}", + type:"post", + data:{partner_id:$("#partner_id option:selected").val(), sdk_type:$("#sdk_version1 option:selected").val()}, + dataType:'json', + success:function(data){ + var str = ""; + for (var i in data){ + str += "" + } + // console.log(str); + $("#game_name").empty(); + $("#game_name").append(str); + $("#game_name").select2(); + + } + }) + } + get_game_list(); $(function(){ $('#timestart').datetimepicker({ diff --git a/Application/Admin/View/TestWhiteList/add.html b/Application/Admin/View/TestWhiteList/add.html index a991e6269..ca9e126b0 100644 --- a/Application/Admin/View/TestWhiteList/add.html +++ b/Application/Admin/View/TestWhiteList/add.html @@ -10,11 +10,12 @@