123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class Roles extends Base
- {
- // 新增
- public function save(){
- model('Roles')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('Roles')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('Roles')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function list(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $name = input('name','','trim');
- $code = input('code','','trim');
- $ret = model('Roles')->lists($page,$size,$name,$code);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('Roles')->del($id);
- HelpHander::success([],'操作成功');
- }
- // 公共角色列表
- public function queryCommonRoles(){
- $ret = model('Roles')->queryCommonRoles();
- HelpHander::success($ret);
- }
- // 查询用户的所有普通角色
- public function queryUserRoles(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $name = input('name','','trim');
- $code = input('code','','trim');
- $phone = input('phone','','trim');
- $depId = input('depId/d',0);
- $jobId = input('jobId/d',0);
- $orgId = input('orgId/d',0);
- $ret = model('Roles')->queryUserRoles($page,$size,$name,$code,$phone,$depId,$jobId,$orgId);
- HelpHander::success($ret);
- }
- // 分配人员组织默认角色(不同组织调人)
- public function saveUserRoles(){
- $uId = input('uId/d',0);
- $orgId = input('orgId/d',0);
- model('Roles')->saveUserRoles($uId,$orgId);
- HelpHander::success([],'操作成功');
- }
- // 获取机构管理员列表
- public function queryUserByRoles(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $account = input('account','','trim');
- $code = input('code','','trim');
- $oId = input('oId/d',0);
- $ret = model('Roles')->queryUserByRoles($page,$size,$account,$code,$oId);
- HelpHander::success($ret);
- }
- // 保存权限
- public function saveRules(){
- model('Roles')->saveRules();
- HelpHander::success([],'操作成功');
- }
- }
|