修改基类
This commit is contained in:
parent
ff297f692e
commit
a186eacc8f
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace app\admin\controller;
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
use think\Exception;
|
||||||
use think\permissions\facade\Roles;
|
use think\permissions\facade\Roles;
|
||||||
use app\validates\RoleValidate;
|
use app\validates\RoleValidate;
|
||||||
use think\permissions\facade\Permissions;
|
use think\permissions\facade\Permissions;
|
||||||
@ -47,10 +48,8 @@ class Role extends Base
|
|||||||
}
|
}
|
||||||
Roles::updateBy($data['id'], $data) !== false ? $this->success('编辑成功', url('role/index')) : $this->error('编辑失败');
|
Roles::updateBy($data['id'], $data) !== false ? $this->success('编辑成功', url('role/index')) : $this->error('编辑失败');
|
||||||
}
|
}
|
||||||
$roleId = $this->request->param('id');
|
|
||||||
$role = Roles::getRoleBy($roleId);
|
|
||||||
|
|
||||||
$this->role = $role;
|
$this->role = Roles::getRoleBy($this->request->param('id'));
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace app\model;
|
|||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
|
||||||
abstract class AbstractBaseModel extends Model
|
class BaseModel extends Model
|
||||||
{
|
{
|
||||||
const LIMIT = 20;
|
const LIMIT = 20;
|
||||||
|
|
@ -4,7 +4,7 @@ namespace app\model;
|
|||||||
|
|
||||||
use think\permissions\traits\hasRoles;
|
use think\permissions\traits\hasRoles;
|
||||||
|
|
||||||
class UserModel extends AbstractBaseModel
|
class UserModel extends BaseModel
|
||||||
{
|
{
|
||||||
use hasRoles;
|
use hasRoles;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user