diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index b847ea327..6bf24fe3f 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -3596,13 +3596,13 @@ class ExportController extends Controller //TODO:应需求,取消玩家表,只要user表的fgame有就算注册无需在play表存在 $play_map = false; if (isset($_REQUEST['game_name'])) { - $map['fgame_name'] = ['like', "{$_REQUEST['game_name']}%"]; + $map['fgame_name'] = $_REQUEST['game_name']; // $play_map = " and up.game_name = '{$_REQUEST['game_name']}' "; } $play_info_map = false; if (isset($_REQUEST['server_id'])) { $play_map = false; //有区服就不检索玩家表,有区服一定已经选择游戏了 - $play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name like '{$_REQUEST['game_name']}%'"; + $play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'"; } $today = total(1); @@ -3616,8 +3616,8 @@ class ExportController extends Controller } } - if (!empty($_REQUEST['game_type'])) { - $map['tab_game.sdk_version'] = $_REQUEST['game_type']; + if (!empty($_REQUEST['admin_id'])) { + $map['promote.admin_id'] = $_REQUEST['admin_id']; } //为数据权限添加 @@ -3626,17 +3626,17 @@ class ExportController extends Controller // 如果是市场专员那么只能看自己的 $isMarketAdmin = isMarketAdmin(); if ($isMarketAdmin) { - $map['tab_promote.admin_id'] = session('user_auth'); + $map['promote.admin_id'] = session('user_auth'); } $data = M("User u","tab_") - ->field("count(u.id) as count,tab_game.relation_game_name,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id") + ->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id") ->join("tab_promote promote ON u.promote_id = promote.id","left") ->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false) ->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false) ->join('tab_game on u.fgame_id = tab_game.id') ->where($map) - ->group('id, tab_game.relation_game_name') + ->group('id') ->order('count desc, register_time') ->select(); //今日/本周/本月不变 @@ -3741,9 +3741,9 @@ class ExportController extends Controller $xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:'推广员注册统计'; $xlsCell = array( array('company_name' , "公司"), - array('promote_account', "推广员账号"), - array('admin_username' , "管理员"), - array('relation_game_name' , "游戏"), + array('promote_account', "会长账号"), + array('admin_username' , "市场专员"), + //array('relation_game_name' , "游戏"), array('count' , "累计注册"), array('rand' , "排行榜"), array('today' , "今日注册"), diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 8cbe9c793..09a7a2366 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -437,13 +437,13 @@ class PlatformController extends ThinkController //TODO:应需求,取消玩家表,只要user表的fgame有就算注册无需在play表存在 $play_map = false; if (isset($_REQUEST['game_name'])) { - $map['fgame_name'] = ['like', "{$_REQUEST['game_name']}%"]; + $map['fgame_name'] = $_REQUEST['game_name']; // $play_map = " and up.game_name = '{$_REQUEST['game_name']}' "; } $play_info_map = false; if (isset($_REQUEST['server_id'])) { $play_map = false; //有区服就不检索玩家表,有区服一定已经选择游戏了 - $play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name like '{$_REQUEST['game_name']}%'"; + $play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'"; } if (!empty($_REQUEST['admin_id'])) { @@ -461,10 +461,6 @@ class PlatformController extends ThinkController } } - if (!empty($_REQUEST['game_type'])) { - $map['tab_game.sdk_version'] = $_REQUEST['game_type']; - } - //为数据权限添加 setPowerPromoteIds($map, 'u.promote_id'); @@ -475,13 +471,13 @@ class PlatformController extends ThinkController } $data = M("User u","tab_") - ->field("count(u.id) as count,tab_game.relation_game_name,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id") + ->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id") ->join("tab_promote promote ON u.promote_id = promote.id","left") ->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false) ->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false) ->join('tab_game on u.fgame_id = tab_game.id') ->where($map) - ->group('id, tab_game.relation_game_name') + ->group('id') ->order('count desc, register_time') ->select(); //今日/本周/本月不变 @@ -662,37 +658,32 @@ class PlatformController extends ThinkController } if (isset($_REQUEST['game_name'])) { - $_REQUEST['game_name'] = "{$_REQUEST['game_name']}"; - $map['s.game_name'] = ['like', "{$_REQUEST['game_name']}%"]; + $map['s.game_name'] = $_REQUEST['game_name']; if (isset($_REQUEST['server_id'])) { $map['s.server_id'] = $_REQUEST['server_id']; unset($_REQUEST['server_id']); } } + if (!empty($_REQUEST['admin_id'])) { + $map['s.market_admin_id'] = $_REQUEST['admin_id']; + } + // 如果是市场专员那么只能看自己的 $isMarketAdmin = isMarketAdmin(); if ($isMarketAdmin) { $map['s.market_admin_id'] = session('user_auth'); } - if (!empty($_REQUEST['game_type'])) { - $map['s.sdk_version'] = $_REQUEST['game_type']; - } - - if (!empty($_REQUEST['admin_id'])) { - $map['s.market_admin_id'] = $_REQUEST['admin_id']; - } - - if (isset($_REQUEST['sdk_version'])||isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) { + if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) { $data = M('promote', 'tab_')->alias('tp1') - ->field('tp1.account as promote_account,tp1.id,g.relation_game_name, + ->field('tp1.account as promote_account,tp1.id, floor(sum(pay_amount)*100) as count') ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left') ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left') ->join("tab_game as g on g.id = s.game_id", 'left') ->where($map) - ->group('tp1.id, g.relation_game_name') + ->group('tp1.id') ->order('count desc') ->select(); } else { @@ -708,7 +699,7 @@ class PlatformController extends ThinkController $tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])]; } $tdata = M('promote', 'tab_')->alias('tp1') - ->field('tp1.account as promote_account,tp1.id,g.relation_game_name, + ->field('tp1.account as promote_account,tp1.id, floor(sum(IF(s.pay_time ' . $today . ',pay_amount,0))*100) as today, floor(sum(IF(s.pay_time ' . $week . ',pay_amount,0))*100) as week, floor(sum(IF(s.pay_time ' . $mounth . ',pay_amount,0))*100) as mounth') @@ -716,7 +707,7 @@ class PlatformController extends ThinkController ->join("tab_spend as s on tp2.id = s.promote_id", 'left') ->join("tab_game as g on g.id = s.game_id", 'left') ->where($tmap) - ->group('tp1.id, g.relation_game_name') + ->group('tp1.id') ->select(); $tmdata = []; foreach($data as $k=>$v){ @@ -725,6 +716,7 @@ class PlatformController extends ThinkController $v['mounth'] = 0; $tmdata[$v['id']] = $v; } + //dd($data); foreach ($tdata as $k => $v) { $tmdata[$v['id']]['today'] = $v['today']; @@ -741,7 +733,7 @@ class PlatformController extends ThinkController foreach($tmdata as $k => $v){ $data[] = $v; } - // dd($data); + //dd($data); unset($map['tp1.id'], $map['tp2.id']); unset($map['tp1.chain']); unset($tmap['tp1.id']); @@ -835,7 +827,6 @@ class PlatformController extends ThinkController 'company_name' => '公司', "promote_account"=>"推广员账号", 'admin_username' => '管理员', - 'relation_game_name' => '游戏', "count"=>"累计充值", "rand"=>"排行榜", "today"=>"今日充值", diff --git a/Application/Admin/View/Platform/promote_statistics.html b/Application/Admin/View/Platform/promote_statistics.html index 80e24e4f9..f3f3e0850 100644 --- a/Application/Admin/View/Platform/promote_statistics.html +++ b/Application/Admin/View/Platform/promote_statistics.html @@ -53,16 +53,16 @@
- +
- +
- - - + +
-
- -
- +
- +
- - - + +
-
- -