diff --git a/app/admin/controller/system/Admin.php b/app/admin/controller/system/Admin.php index 08be2d4..9b05922 100644 --- a/app/admin/controller/system/Admin.php +++ b/app/admin/controller/system/Admin.php @@ -99,7 +99,6 @@ class Admin extends AdminController } $save ? $this->success('保存成功') : $this->error('保存失败'); } - $row->auth_ids = explode(',', $row->auth_ids ?: ''); $this->assign('row', $row); return $this->fetch(); } diff --git a/app/admin/model/SystemAdmin.php b/app/admin/model/SystemAdmin.php index 03abf16..faa3e3d 100644 --- a/app/admin/model/SystemAdmin.php +++ b/app/admin/model/SystemAdmin.php @@ -22,6 +22,12 @@ class SystemAdmin extends TimeModel ], ]; + public function getAuthIdsAttr($value): array + { + if (!$value) return []; + return explode(',', $value); + } + public function getAuthList(): array { return (new SystemAuth())->removeOption('where')->where('status', 1)->column('title', 'id');