diff --git a/Application/Admin/Controller/CompanyGameRatioController.class.php b/Application/Admin/Controller/CompanyGameRatioController.class.php index c7ddcabee..6c53c0b4a 100644 --- a/Application/Admin/Controller/CompanyGameRatioController.class.php +++ b/Application/Admin/Controller/CompanyGameRatioController.class.php @@ -46,7 +46,6 @@ class CompanyGameRatioController extends AdminController if(isset($params['company_belong'])){ $pwhere = " and p.company_belong = {$params['company_belong']}"; } - if(isset($params['company_id'])){ $where['m.company_id'] = $params['company_id']; @@ -69,6 +68,21 @@ class CompanyGameRatioController extends AdminController } } + $isMarketAdmin = isMarketAdmin(); + if($isMarketAdmin) { + $userAuth = session('user_auth'); + $adminId = $userAuth['uid']; + $companyIds = M('promote', 'tab_')->where(['admin_id' => $adminId, 'level' => 1])->getField('company_id', true); + $companyIds = array_unique($companyIds); + $marketCondition = ''; + if (count($companyIds) > 0) { + $marketCondition = 'm.company_id in(' . implode(',', $companyIds) . ')'; + } else { + $marketCondition = '1<>1'; + } + $where['_string'] = isset($where['_string']) ? $where['_string'] . ' and ' . $marketCondition : $marketCondition; + } + if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { $time_start = strtotime($_REQUEST['time_start']); $time_end = strtotime($_REQUEST['time_end'])+ 86399;