修改推广游戏分成市场专员权限控制

master
ELF 5 years ago
parent de21d622d8
commit bb8052614b

@ -47,7 +47,6 @@ class CompanyGameRatioController extends AdminController
$pwhere = " and p.company_belong = {$params['company_belong']}"; $pwhere = " and p.company_belong = {$params['company_belong']}";
} }
if(isset($params['company_id'])){ if(isset($params['company_id'])){
$where['m.company_id'] = $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(['amdin_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['_sttring'] = isset($where['_sttring']) ? $where['_sttring'] . ' and ' . $marketCondition : $marketCondition;
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']); $time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399; $time_end = strtotime($_REQUEST['time_end'])+ 86399;

Loading…
Cancel
Save