diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index e27ed0c5d..050908ab7 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -345,7 +345,11 @@ class FinancePromoteController extends AdminController $map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399]; } //判断是否有推广员 + $level = 1; if ($_REQUEST['promote_id'] != '') { + if ($_REQUEST['promote_id'] != 0){ + $level = M('promote', 'tab_')->field('level')->where(array('id' => $_REQUEST['promote_id']))->find()['level']; + } if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) { $map['s.promote_id'] = $_REQUEST['promote_id']; } else { @@ -355,6 +359,7 @@ class FinancePromoteController extends AdminController } } } + $this->assign('promote_level', $level); //游戏统计列表 $data =self::gameStatisticsData($map, $row, $p); @@ -388,6 +393,18 @@ class FinancePromoteController extends AdminController //游戏订单详情 public function gameStatisticsDetail($p = 1) { set_time_limit(0); + if(isset($_REQUEST['game_id'])){ + + //转化为名称和类型,重新请求 + $game = M("game","tab_")->field("relation_game_name,sdk_version")->where(" id = {$_REQUEST['game_id']} ")->find(); + if($game === false){ + $this->error("参数错误"); + } + $_GET['game_name'] = $game['relation_game_name']; + $_GET['game_type'] = $game['sdk_version']; + unset($_GET['game_id']); + $this->redirect(ACTION_NAME, I('get.')); + } if (isset($_REQUEST['pay_way'])) { $map['pay_way'] = $_REQUEST['pay_way']; @@ -396,13 +413,16 @@ class FinancePromoteController extends AdminController if (!empty($_REQUEST['pay_order_number'])) { $map['pay_order_number'] = $_REQUEST['pay_order_number']; } - - if (!empty(I('partner_id'))&&empty(I("game_id"))) { + + if (!empty(I('partner_id'))) { $wherePartner = I('partner_id'); $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); $gameId = implode(',',array_column($gameId,'id')); $map['game_id'] = ['in',$gameId]; } + if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { + $map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { $map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]]; @@ -423,9 +443,6 @@ class FinancePromoteController extends AdminController } } } - // if (!empty(I("promote_id"))) { - // $promote_id[] = I("promote_id"); - // } if (!empty(I("root_id"))) { $root_id = I("root_id"); @@ -459,7 +476,6 @@ class FinancePromoteController extends AdminController if (!empty(I('user_nickname'))) { $map['game_player_name'] = array('like',I("user_nickname").'%'); } - // var_dump($map);die(); $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; $group = ""; $order = "pay_time DESC"; @@ -468,7 +484,7 @@ class FinancePromoteController extends AdminController $data[$key]['pay_way'] = getPayType($value['pay_way']); } - $totalData = D('spend')->totalGameStatistics($map, false); + $totalData = self::totalGameStatisticsData($map, false); $sumCash = $totalData['cash_count'] ?? 0; $sumBalance = $totalData['balance_coin_count'] ?? 0; $sumInside = $totalData['inside_cash_count'] ?? 0; @@ -507,6 +523,7 @@ class FinancePromoteController extends AdminController $query = $query->page($page,$row); } $data = $query->select(); + // dump($data);die(); return $data; } private function totalGameStatisticsData($map, $join = true) @@ -519,7 +536,7 @@ class FinancePromoteController extends AdminController $query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id') ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id'); } - $data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1]) + $data = $query->where(['s.pay_status' => 1]) ->where($map) ->find(); return $data; diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html index b6f999bb0..2adaefccd 100644 --- a/Application/Admin/View/FinancePromote/gameStatistics.html +++ b/Application/Admin/View/FinancePromote/gameStatistics.html @@ -82,7 +82,7 @@ 统计推广员及其下属推广员的游戏相关统计 - 仅统计推广员自己 不含其下属推广员的游戏相关统计 + 仅统计推广员自己 不含其下属推广员的游戏相关统计 游戏相关统计 @@ -106,9 +106,6 @@
@@ -214,7 +211,7 @@ false))}">{$data.inside_cash_count}0 {$data.all_cash_count}0 - 订单查看 + 订单查看 @@ -225,7 +222,7 @@ {$sumInside}0 {$sumAll}0 - 订单查看 + 订单查看 @@ -279,16 +276,14 @@ var href = $(this).attr('href'); $(this).removeAttr('href'); window.location.replace(href) - console.log(href) }); //导航高亮 - highlight_subnav('{:U('Finance/gameStatistics')}'); + highlight_subnav('{:U("FinancePromote/index")}'); $(function(){ //搜索功能 $("#search").click(function(){ - console.log(111); var starttime = $.trim($('#time-start').val()); var endtime = $.trim($('#time-end').val()); @@ -349,7 +344,7 @@ } }) } - $("#partner_id, #sdk_type").change(function(){ + $("#partner_id, #game_type").change(function(){ get_game_list(); }); $('#time_start').datetimepicker({ @@ -366,40 +361,6 @@ autoclose: true, pickerPosition: 'bottom-left' }) - // $('#time-start').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // showMeridian:true, - // pickDate:true, - // minView: 2, - // autoclose: true, - // pickTime:true, - // todayBtn:true, - // }).on('change',function(ev){ - // var val = new Date($.trim($(this).val())).getTime(); - // var end = new Date($.trim($('#time-end').val())).getTime(); - // if (val>end) { - // layer.msg('开始时间大于结束时间!');$(this).val(''); - // } - // return false; - // }); - - // $("#time-end").datetimepicker({ - // format:"yyyy-mm-dd", - // language: "zh-CN", - // showMeridian:true, - // minView:2, - // autoclose:true, - // todayBtn:true, - // }).on('change',function(ev){ - // var val = new Date($.trim($(this).val())).getTime(); - // var start = new Date($.trim($('#time-start').val())).getTime(); - // if (val -

{$_REQUEST['game_name']}游戏订单查看

-

+

+ + [{:get_promote_name(I('promote_id'))}] + + {$_REQUEST['game_name']}游戏订单查看

+

+ + + 统计推广员及其下属推广员的游戏订单相关统计 + + 仅统计推广员自己 不含其下属推广员的游戏订单相关统计 + + + 游戏订单统计 + +

@@ -40,12 +54,52 @@
-
+ - - - +
+ +
+
+ +
+
+ +
+
+ +
+
+ + - +
+
+ +
+ + + +
  @@ -199,7 +253,7 @@ diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index fe9982182..f6d2aad3a 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -271,7 +271,7 @@