Merge pull request '优化' (#449) from feature/testing_resource_lhcgx into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/449
master
廖金灵 3 years ago
commit 7c7d901af5

@ -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()

@ -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];
}
}

Loading…
Cancel
Save