Merge branch 'feature/company_game_rotio_perm' of wmtx/platform into release

修改推广游戏分成市场专员权限控制
master
廖金灵 5 years ago committed by Gogs
commit 37a84b8ce7

@ -46,7 +46,6 @@ class CompanyGameRatioController extends AdminController
if(isset($params['company_belong'])){ if(isset($params['company_belong'])){
$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(['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'])) { 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