diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 31d47049c..5dd07f55a 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2939,11 +2939,11 @@ function getSearchAdminIds($searchAdminParam = 'admin_id', $searchDepartmentPara return $adminIds; } -function needSearchDepartment() +function isUnMarketAdmin() { $isMarketAdmin = isMarketAdmin(); $isMarketLeader = isMarketLeader(); - return !$isMarketLeader && !$isMarketAdmin && !empty($_REQUEST['department_id']); + return !$isMarketLeader && !$isMarketAdmin; } function isMarketAdmin() diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 707af6563..3211fb8a5 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -272,7 +272,7 @@ class FinancePromoteController extends AdminController } $adminIds = getSearchAdminIds(); - $needSearch = needSearchDepartment(); + $isUnMarketAdmin = isUnMarketAdmin(); if($type == "spend"){ if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { $map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); @@ -284,9 +284,10 @@ class FinancePromoteController extends AdminController $map['s.market_admin_id'] = ['gt', 0]; } if (is_array($adminIds)) { - $map['s.market_admin_id'] = ['in', $adminIds]; - if ($needSearch) { + if ($isUnMarketAdmin) { $map['promote.admin_id'] = ['in', $adminIds]; + } else { + $map['s.market_admin_id'] = ['in', $adminIds]; } } $map['s.pay_status']=1; @@ -346,7 +347,7 @@ class FinancePromoteController extends AdminController } $adminIds = getSearchAdminIds(); - $needSearch = needSearchDepartment(); + $isUnMarketAdmin = isUnMarketAdmin(); if($type == "spend"){ if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { $map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); @@ -358,9 +359,10 @@ class FinancePromoteController extends AdminController $map['s.market_admin_id'] = ['gt', 0]; } if (is_array($adminIds)) { - $map['s.market_admin_id'] = ['in', $adminIds]; - if ($needSearch) { + if ($isUnMarketAdmin) { $map['promote.admin_id'] = ['in', $adminIds]; + } else { + $map['s.market_admin_id'] = ['in', $adminIds]; } } $map['s.pay_status']=1; @@ -575,7 +577,7 @@ class FinancePromoteController extends AdminController } $adminIds = getSearchAdminIds(); - $needSearch = needSearchDepartment(); + $isUnMarketAdmin = isUnMarketAdmin(); if ($type == "spend") { if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { $map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); @@ -589,9 +591,10 @@ class FinancePromoteController extends AdminController $map['promote.admin_id'] = ['gt', 0]; } if (is_array($adminIds)) { - $map['s.market_admin_id'] = ['in', $adminIds]; - if ($needSearch) { + if ($isUnMarketAdmin) { $map['promote.admin_id'] = ['in', $adminIds]; + } else { + $map['s.market_admin_id'] = ['in', $adminIds]; } } $map['s.pay_status']=1; @@ -957,11 +960,12 @@ class FinancePromoteController extends AdminController private function gameStatisticsData($map, $row = 0, $page = 1) { $adminIds = getSearchAdminIds(); - $needSearch = needSearchDepartment(); + $isUnMarketAdmin = isUnMarketAdmin(); if (is_array($adminIds)) { - $map['s.market_admin_id'] = ['in', $adminIds]; - if ($needSearch) { + if ($isUnMarketAdmin) { $map['promote.admin_id'] = ['in', $adminIds]; + } else { + $map['s.market_admin_id'] = ['in', $adminIds]; } } @@ -996,11 +1000,12 @@ class FinancePromoteController extends AdminController private function totalGameStatisticsData($map, $join = true) { $adminIds = getSearchAdminIds(); - $needSearch = needSearchDepartment(); + $isUnMarketAdmin = isUnMarketAdmin(); if (is_array($adminIds)) { - $map['s.market_admin_id'] = ['in', $adminIds]; - if ($needSearch) { + if ($isUnMarketAdmin) { $map['promote.admin_id'] = ['in', $adminIds]; + } else { + $map['s.market_admin_id'] = ['in', $adminIds]; } }