init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
use Common\Business\Role;
|
||||
use Think\Controller;
|
||||
|
||||
//[1.9.13]
|
||||
|
||||
/**
|
||||
* 合伙人角色管理
|
||||
* Class AdminRolesController
|
||||
* @package Admin\Controller
|
||||
*/
|
||||
class AdminRolesController extends BaseController
|
||||
{
|
||||
/**
|
||||
* 角色列表页
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色列表
|
||||
*/
|
||||
public function getRoles()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->getRoleList([
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'user_type' => 1,
|
||||
'page' => I('post.page'),
|
||||
'limit' => I('post.limit'),
|
||||
'keyword' => I('post.keyword'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改开启关闭状态
|
||||
*/
|
||||
public function changeStatus()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->changeCustomerRoleStatus([
|
||||
'id' => I('post.id'),
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'user_type' => 1,
|
||||
'source' => 0,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色删除
|
||||
*/
|
||||
public function rolesDel()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->delCustomerRole([
|
||||
'id' => I('post.id'),
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'user_type' => 1,
|
||||
'source' => 0,
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色添加页面
|
||||
*/
|
||||
public function rolesAdd()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限列表
|
||||
*/
|
||||
public function getAllJurList()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->getRole([
|
||||
'operate_type' => 1,
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'group_id' => $this->login_user['jurisdiction_group_id'],
|
||||
'next_user_type' => $this->login_user['login_type'],
|
||||
'next_id' => I('post.group_id'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色添加
|
||||
*/
|
||||
public function rolesAddAjax()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->setRole([
|
||||
'operate_type' => 1,
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'group_id' => $this->login_user['jurisdiction_group_id'],
|
||||
'next_user_type' => $this->login_user['login_type'],
|
||||
'next_id' => I('post.group_id'),
|
||||
'role_name' => I('post.role_name'),
|
||||
'status' => I('post.status'),
|
||||
'checkIds' => I('post.checkIds'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商菜单栏权限
|
||||
*/
|
||||
public function getAgentRole()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->getRole([
|
||||
'operate_type' => 2,
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'next_user_type' => 2,
|
||||
'next_id' => I('post.agent_id'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存代理商菜单栏权限
|
||||
*/
|
||||
public function setAgentRole()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->setRole([
|
||||
'operate_type' => 2,
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'next_user_type' => 2,
|
||||
'next_id' => I('post.agent_id'),
|
||||
'checkIds' => I('post.checkIds'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商权限操作记录
|
||||
*/
|
||||
public function getRoleRecord()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->getRoleRecord([
|
||||
'operator_user_id' => I('post.operator_id'),
|
||||
'operate_type' => 2,
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'next_user_type' => 2,
|
||||
'next_id' => I('post.agent_id'),
|
||||
'page' => I('post.page'),
|
||||
'limit' => I('post.limit'),
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取操作者列表-供选择
|
||||
*/
|
||||
public function getOperatorList()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->getOperatorList([
|
||||
'user_id' => $this->login_user['id'],
|
||||
'user_type' => $this->login_user['user_type'],
|
||||
'first_pid' => $this->login_user['first_pid'],
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置代理商权限为初始状态
|
||||
*/
|
||||
public function resetUserRole()
|
||||
{
|
||||
$Role = new Role();
|
||||
$this->ajaxReturn($Role->resetUserRole([
|
||||
'operator_id' => $this->login_user['id'],
|
||||
'next_id' => I('post.agent_id'),
|
||||
'next_user_type' => 2,
|
||||
]));
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户