|
|
|
@ -14,6 +14,7 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
{
|
|
|
|
|
private $modelName = 'SocietyInfo';
|
|
|
|
|
private $admininfo = '';
|
|
|
|
|
private $MarketEvent;
|
|
|
|
|
private $level = [
|
|
|
|
|
1=>'S',
|
|
|
|
|
2=>'A',
|
|
|
|
@ -24,6 +25,7 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
public function _initialize()
|
|
|
|
|
{
|
|
|
|
|
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
|
|
|
|
|
$this->MarketEvent = A("Market","Event");
|
|
|
|
|
parent::_initialize();
|
|
|
|
|
}
|
|
|
|
|
//列表
|
|
|
|
@ -32,11 +34,20 @@ class SocietyInfoController extends ThinkController
|
|
|
|
|
$model = M($this->modelName, 'tab_');
|
|
|
|
|
$map = [];
|
|
|
|
|
|
|
|
|
|
if ($this->checkRule("Admin/SocietyInfo/lists", array('in','1,2')) || isMarketLeader() || is_administrator()) {
|
|
|
|
|
if (is_administrator()) {
|
|
|
|
|
// 设置权限、admin、市场总监可以看所有数据
|
|
|
|
|
} else {
|
|
|
|
|
// 其他用户只能看自己的
|
|
|
|
|
$map['create_account'] = $this->admininfo['username'];
|
|
|
|
|
$gid = session('user_group_id');
|
|
|
|
|
$markerGroup = $this->MarketEvent->isMarketAdminGroup($gid);
|
|
|
|
|
if($markerGroup){
|
|
|
|
|
if($markerGroup['department_level'] == $this->MarketEvent->getConfig("DirectorLevel")){
|
|
|
|
|
//总监
|
|
|
|
|
$map['create_account'] = ["in",$this->MarketEvent->getDepartmentUserId($markerGroup['department_id'],"nickname")];
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
// 其他用户只能看自己的
|
|
|
|
|
$map['create_account'] = $this->admininfo['username'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($_REQUEST['text']||$_REQUEST['text']=='0') {
|
|
|
|
|