同步模型静态方式

This commit is contained in:
Anyon 2022-04-19 15:01:41 +08:00
parent d33c2aa8c5
commit 2c882556e9
2 changed files with 6 additions and 10 deletions

View File

@ -39,7 +39,7 @@ class Base extends Controller
{ {
SystemBase::mQuery()->layTable(function () { SystemBase::mQuery()->layTable(function () {
$this->title = '数据字典管理'; $this->title = '数据字典管理';
$this->types = SystemBase::mk()->types(); $this->types = SystemBase::types();
$this->type = input('get.type', $this->types[0] ?? '-'); $this->type = input('get.type', $this->types[0] ?? '-');
}, function (QueryHelper $query) { }, function (QueryHelper $query) {
$query->where(['deleted' => 0])->equal('type'); $query->where(['deleted' => 0])->equal('type');
@ -72,7 +72,7 @@ class Base extends Controller
protected function _form_filter(array &$data) protected function _form_filter(array &$data)
{ {
if ($this->request->isGet()) { if ($this->request->isGet()) {
$this->types = SystemBase::mk()->types(); $this->types = SystemBase::types();
$this->types[] = '--- 新增类型 ---'; $this->types[] = '--- 新增类型 ---';
$this->type = input('get.type') ?: ($this->types[0] ?? '-'); $this->type = input('get.type') ?: ($this->types[0] ?? '-');
} else { } else {

View File

@ -46,15 +46,11 @@ class User extends Controller
// 创建快捷查询工具 // 创建快捷查询工具
SystemUser::mQuery()->layTable(function () { SystemUser::mQuery()->layTable(function () {
$this->title = '系统用户管理'; $this->title = '系统用户管理';
$this->bases = SystemBase::mk()->items('身份权限'); $this->bases = SystemBase::items('身份权限');
}, function (QueryHelper $query) { }, function (QueryHelper $query) {
// 加载对应数据列表 // 加载对应数据列表
if ($this->type === 'index') { $query->where(['is_deleted' => 0, 'status' => intval($this->type === 'index')]);
$query->where(['is_deleted' => 0, 'status' => 1]);
} elseif ($this->type = 'recycle') {
$query->where(['is_deleted' => 0, 'status' => 0]);
}
// 关联用户身份资料 // 关联用户身份资料
$query->with(['userinfo' => function (Relation $relation) { $query->with(['userinfo' => function (Relation $relation) {
@ -145,10 +141,10 @@ class User extends Controller
// 权限绑定处理 // 权限绑定处理
$data['authorize'] = str2arr($data['authorize'] ?? ''); $data['authorize'] = str2arr($data['authorize'] ?? '');
// 用户身份数据 // 用户身份数据
$this->bases = SystemBase::mk()->items('身份权限'); $this->bases = SystemBase::items('身份权限');
// 用户权限管理 // 用户权限管理
$this->superName = AdminService::instance()->getSuperName(); $this->superName = AdminService::instance()->getSuperName();
$this->authorizes = SystemAuth::mk()->items(); $this->authorizes = SystemAuth::items();
} }
} }