|
|
@ -6,6 +6,7 @@ class CompanyGameRatioController extends AdminController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public $admininfo;
|
|
|
|
public $admininfo;
|
|
|
|
public $DBModel;
|
|
|
|
public $DBModel;
|
|
|
|
|
|
|
|
public $MarketEvent;
|
|
|
|
public $OpAuthList=[];
|
|
|
|
public $OpAuthList=[];
|
|
|
|
public $Status = [
|
|
|
|
public $Status = [
|
|
|
|
"-2"=>"管理员拒绝",
|
|
|
|
"-2"=>"管理员拒绝",
|
|
|
@ -24,6 +25,7 @@ class CompanyGameRatioController extends AdminController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
|
|
|
|
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
|
|
|
|
$this->DBModel = M("company_game_ratio","tab_");
|
|
|
|
$this->DBModel = M("company_game_ratio","tab_");
|
|
|
|
|
|
|
|
$this->MarketEvent = A("Market","Event");
|
|
|
|
parent::_initialize();
|
|
|
|
parent::_initialize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -78,18 +80,16 @@ class CompanyGameRatioController extends AdminController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$gid = session('user_group_id');
|
|
|
|
$isMarketAdmin = isMarketAdmin();
|
|
|
|
$markerGroup = $this->MarketEvent->isMarketAdminGroup($gid);
|
|
|
|
if($isMarketAdmin) {
|
|
|
|
if($markerGroup){
|
|
|
|
$userAuth = session('user_auth');
|
|
|
|
$companyIds = $this->MarketEvent->getAdminCompanyId();
|
|
|
|
$adminId = $userAuth['uid'];
|
|
|
|
//取消0
|
|
|
|
$companyIds = M('promote', 'tab_')->where(['admin_id' => $adminId, 'level' => 1])->getField('company_id', true);
|
|
|
|
$companyIds = implode(",",array_diff(explode(",",$companyIds),[0]));
|
|
|
|
$companyIds = array_unique($companyIds);
|
|
|
|
$marketCondition = 'm.company_id in(' . $companyIds . ')';
|
|
|
|
$marketCondition = '';
|
|
|
|
if($markerGroup['department_level'] == $this->MarketEvent->getConfig("DirectorLevel")){
|
|
|
|
if (count($companyIds) > 0) {
|
|
|
|
//总监
|
|
|
|
$marketCondition = 'm.company_id in(' . implode(',', $companyIds) . ')';
|
|
|
|
$marketCondition .= " OR (m.company_id = 0 AND m.company_belong != 0 )";
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$marketCondition = '1<>1';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$where['_string'] = isset($where['_string']) ? $where['_string'] . ' and ' . $marketCondition : $marketCondition;
|
|
|
|
$where['_string'] = isset($where['_string']) ? $where['_string'] . ' and ' . $marketCondition : $marketCondition;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -265,6 +265,22 @@ class CompanyGameRatioController extends AdminController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$gid = session('user_group_id');
|
|
|
|
|
|
|
|
$markerGroup = $this->MarketEvent->isMarketAdminGroup($gid);
|
|
|
|
|
|
|
|
if($markerGroup){
|
|
|
|
|
|
|
|
$companyIds = $this->MarketEvent->getAdminCompanyId();
|
|
|
|
|
|
|
|
//取消0
|
|
|
|
|
|
|
|
$companyIds = implode(",",array_diff(explode(",",$companyIds),[0]));
|
|
|
|
|
|
|
|
$marketCondition = 'm.company_id in(' . $companyIds . ')';
|
|
|
|
|
|
|
|
if($markerGroup['department_level'] == $this->MarketEvent->getConfig("DirectorLevel")){
|
|
|
|
|
|
|
|
//总监
|
|
|
|
|
|
|
|
$marketCondition .= " OR (m.company_id = 0 AND m.company_belong != 0 )";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$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;
|
|
|
|