diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index 4dbe626e8..b59e9d615 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -91,6 +91,8 @@ class AjaxController extends ThinkController{ $map = []; if ($game) { $map['game_id'] = ['in', $game]; + } else { + $map['game_id'] = ['in', [-1]]; } $data = M('Server', 'tab_')->field('id, server_name, server_id')->where($map)->group('server_name')->select(); $this->AjaxReturn($data); diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 77ee795e0..1b9359ce3 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1916,6 +1916,25 @@ class ExportController extends Controller } break; case 23: + $params = I('get.'); + $map['tab_game_supersign.pay_status'] = 1; + if (isset($params['order_id'])) { + $map['tab_game_supersign.order_id'] = $params['order_id']; + } + if (isset($params['account'])) { + $map['tab_user.account'] = $params['account']; + } + if (isset($params['promote_id'])) { + $promoteId = $params['promote_id']; + if ($promoteId == 0) { + $map['promote_id'] = 0; + } else { + $promoteMap['chain'] = ['like', "%/$promoteId/%"]; + $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $map['tab_user.promote_id'] = ['in', $promoteIds]; + } + } $xlsCell = array( array('order_id', '订单号'), array('account', '游戏账号'), @@ -1925,7 +1944,7 @@ class ExportController extends Controller array('pay_time', '购买时间'), array('super_money', '超级签金额'), ); - $xlsData = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where(['tab_game_supersign.pay_status' => 1])->order('id DESC')->select(); + $xlsData = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->order('id DESC')->select(); foreach($xlsData as $k => $v) { $xlsData[$k]['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']); } @@ -3097,9 +3116,15 @@ class ExportController extends Controller $end_time = $end = strtotime($end) + 86400; $map = " 1=1 "; + $game_map = ""; if (isset($_REQUEST['game_name'])) { + $game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')); $map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + $game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play_info as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id "; + if (isset($_REQUEST['server_name'])) $game_map .= " AND upi.server_name = '{$_REQUEST['server_name']}' "; + $game_map .= ") "; } + if (isset($_REQUEST['server_name'])) { $map .= " AND server_name = '{$_REQUEST['server_name']}' "; } @@ -3114,10 +3139,11 @@ class ExportController extends Controller tab_user u WHERE u.register_time BETWEEN {$start_time} - AND {$end_time} + AND {$end_time} {$game_map} GROUP BY reg_date ORDER BY reg_date asc "); + $result = []; foreach ($users as $index => $item) { $ltv_start = strtotime($item['reg_date']); @@ -3133,7 +3159,7 @@ class ExportController extends Controller ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7, ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14, ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30, - SUM(pay_amount) as total_amt + SUM(if (pay_time BETWEEN {$start_time} and ".($end_time).", pay_amount, 0)) as total_amt FROM tab_spend WHERE diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 37f290871..e1653bac4 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -126,7 +126,9 @@ class PromoteGameRatioController extends ThinkController $params = I('get.'); $id = $params['id'] ?? 0; $id = intval($id); + $metaTitle = '游戏分成比例申请'; if ($id) { + $metaTitle .= '--修改'; $field = 'promote_id, game_id, ratio, begin_time, end_time, remark'; $map['id'] = $id; $promoteGameRatio = D(self::MODEL_NAME)->field($field)->where($map)->find(); @@ -138,7 +140,7 @@ class PromoteGameRatioController extends ThinkController $this->assign('gameList', getAllGameList()); $this->assign('promoteList', getPromoteByLevel(1)); - $this->meta_title = '游戏分成比例申请'; + $this->meta_title = $metaTitle; $this->display(); } } diff --git a/Application/Admin/Controller/StatisticsController.class.php b/Application/Admin/Controller/StatisticsController.class.php index 31040e7d4..d0e083ee1 100644 --- a/Application/Admin/Controller/StatisticsController.class.php +++ b/Application/Admin/Controller/StatisticsController.class.php @@ -1002,12 +1002,17 @@ if ($payids) { $end_time = $end_time > $end ? $end : $end_time; $map = " 1=1 "; + $game_map = ""; if (isset($_REQUEST['game_name'])) { - $map .= " AND game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")"; + $game_ids = implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')); + $map .= " AND game_id in ({$game_ids})"; + $game_map = " AND EXISTS (SELECT upi.user_id FROM tab_user_play_info as upi where upi.game_id in ({$game_ids}) AND upi.user_id = u.id "; + if (isset($_REQUEST['server_name'])) $game_map .= " AND upi.server_name = '{$_REQUEST['server_name']}' "; + $game_map .= ") "; } if (isset($_REQUEST['server_name'])) { $map .= " AND server_name = '{$_REQUEST['server_name']}' "; - } + } // 获取包含的用户id $users = M()->query(" SELECT @@ -1018,7 +1023,7 @@ if ($payids) { tab_user u WHERE u.register_time BETWEEN {$start_time} - AND {$end_time} + AND {$end_time} {$game_map} GROUP BY reg_date ORDER BY reg_date asc "); @@ -1037,7 +1042,7 @@ if ($payids) { ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7, ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14, ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30, - SUM(pay_amount) as total_amt + SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0)) as total_amt FROM tab_spend WHERE diff --git a/Application/Admin/Controller/SuperStatisticalController.class.php b/Application/Admin/Controller/SuperStatisticalController.class.php index a2bfc3b93..5b11bc33f 100644 --- a/Application/Admin/Controller/SuperStatisticalController.class.php +++ b/Application/Admin/Controller/SuperStatisticalController.class.php @@ -102,8 +102,27 @@ class SuperStatisticalController extends ThinkController public function superDetail($p = 1,$row = 10) { $page = $p ? $p : 1; $row = $row ? $row : 10; - $data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where(['tab_game_supersign.pay_status' => 1])->page($page,$row)->order('id DESC')->select(); - $count = M('game_supersign', 'tab_')->field('tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where(['tab_game_supersign.pay_status' => 1])->count(); + $params = I('get.'); + $map['tab_game_supersign.pay_status'] = 1; + if (isset($params['order_id'])) { + $map['tab_game_supersign.order_id'] = $params['order_id']; + } + if (isset($params['account'])) { + $map['tab_user.account'] = $params['account']; + } + if (isset($params['promote_id'])) { + $promoteId = $params['promote_id']; + if ($promoteId == 0) { + $map['promote_id'] = 0; + } else { + $promoteMap['chain'] = ['like', "%/$promoteId/%"]; + $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $map['tab_user.promote_id'] = ['in', $promoteIds]; + } + } + $data = M('game_supersign', 'tab_')->field('tab_game_supersign.id,tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->page($page,$row)->order('id DESC')->select(); + $count = M('game_supersign', 'tab_')->field('tab_game_supersign.order_id,tab_user.account,tab_user.promote_account,tab_user.device_number,tab_game.game_name,tab_game_supersign.pay_time')->join('tab_user on tab_game_supersign.user_id = tab_user.id')->join('tab_game on tab_game_supersign.game_id = tab_game.id')->where($map)->count(); $super_money_all = $count * $this->super_money; $page = set_pagination($count, $row); diff --git a/Application/Admin/Controller/access_data_foldline.txt b/Application/Admin/Controller/access_data_foldline.txt index 89c4789df..1d3b7b6d6 100644 --- a/Application/Admin/Controller/access_data_foldline.txt +++ b/Application/Admin/Controller/access_data_foldline.txt @@ -1 +1 @@ -{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":1},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":1},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":2,"active":13,"player":5,"money":1330.05},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":3},{"time":"10:00","count":2},{"time":"11:00","count":2},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":1},{"time":"16:00","count":0},{"time":"17:00","count":1},{"time":"18:00","count":0},{"time":"19:00","count":2},{"time":"20:00","count":0},{"time":"21:00","count":1},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":1},{"time":"16:00","count":2},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":"962.00"},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":"356.00"},{"time":"15:00","count":"0.03"},{"time":"16:00","count":"12.02"},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]} \ No newline at end of file +{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":2},{"time":"16:00","count":2},{"time":"17:00","count":1},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":5,"active":17,"player":1,"money":6},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":3},{"time":"10:00","count":1},{"time":"11:00","count":3},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":1},{"time":"15:00","count":3},{"time":"16:00","count":4},{"time":"17:00","count":2},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":1},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":"6.00"},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]} \ No newline at end of file diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html index 776077526..fe674744d 100644 --- a/Application/Admin/View/PromoteGameRatio/applyRatio.html +++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html @@ -5,6 +5,15 @@ +