diff --git a/app/admin/controller/system/Admin.php b/app/admin/controller/system/Admin.php index 9b05922..44570e6 100644 --- a/app/admin/controller/system/Admin.php +++ b/app/admin/controller/system/Admin.php @@ -70,7 +70,7 @@ class Admin extends AdminController try { $save = $this->model->save($post); }catch (\Exception $e) { - $this->error('保存失败'); + $this->error('保存失败' . $e->getMessage()); } $save ? $this->success('保存成功') : $this->error('保存失败'); } @@ -88,14 +88,11 @@ class Admin extends AdminController $post['auth_ids'] = implode(',', array_keys($authIds)); $rule = []; $this->validate($post, $rule); - if (isset($row['password'])) { - unset($row['password']); - } try { $save = $row->save($post); TriggerService::updateMenu($id); }catch (\Exception $e) { - $this->error('保存失败'); + $this->error('保存失败' . $e->getMessage()); } $save ? $this->success('保存成功') : $this->error('保存失败'); } diff --git a/app/admin/controller/system/Config.php b/app/admin/controller/system/Config.php index 1ec36c4..6bebcdc 100644 --- a/app/admin/controller/system/Config.php +++ b/app/admin/controller/system/Config.php @@ -41,12 +41,12 @@ class Config extends AdminController if ($group == 'upload') { $upload_types = config('admin.upload_types'); // 兼容旧版本 - $this->model->removeOption('where')->where('name', 'upload_allow_type')->update(['value' => implode(',', array_keys($upload_types))]); + $this->model->removeOption()->where('name', 'upload_allow_type')->update(['value' => implode(',', array_keys($upload_types))]); } foreach ($post as $key => $val) { if (in_array($key, $notAddFields)) continue; - if ($this->model->removeOption('where')->where('name', $key)->count()) { - $this->model->removeOption('where')->where('name', $key)->update(['value' => $val,]); + if ($this->model->removeOption()->where('name', $key)->count()) { + $this->model->removeOption()->where('name', $key)->update(['value' => $val,]); }else { $this->model->create( [ @@ -59,7 +59,7 @@ class Config extends AdminController TriggerService::updateMenu(); TriggerService::updateSysConfig(); }catch (\Exception $e) { - $this->error('保存失败' .$e->getMessage()); + $this->error('保存失败' . $e->getMessage()); } $this->success('保存成功'); } diff --git a/app/admin/controller/system/Node.php b/app/admin/controller/system/Node.php index da0eff2..21a144d 100644 --- a/app/admin/controller/system/Node.php +++ b/app/admin/controller/system/Node.php @@ -58,11 +58,11 @@ class Node extends AdminController try { if ($force == 1) { - $updateNodeList = $model->removeOption('where')->whereIn('node', array_column($nodeList, 'node'))->select(); + $updateNodeList = $model->removeOption()->whereIn('node', array_column($nodeList, 'node'))->select(); $formatNodeList = array_format_key($nodeList, 'node'); foreach ($updateNodeList as $vo) { isset($formatNodeList[$vo['node']]) - && $model->removeOption('where')->where('id', $vo['id'])->update( + && $model->removeOption()->where('id', $vo['id'])->update( [ 'title' => $formatNodeList[$vo['node']]['title'], 'is_auth' => $formatNodeList[$vo['node']]['is_auth'], @@ -70,7 +70,7 @@ class Node extends AdminController ); } } - $existNodeList = $model->removeOption('where')->field('node,title,type,is_auth')->select(); + $existNodeList = $model->removeOption()->field('node,title,type,is_auth')->select(); foreach ($nodeList as $key => $vo) { foreach ($existNodeList as $v) { if ($vo['node'] == $v->node) { diff --git a/app/admin/model/SystemAdmin.php b/app/admin/model/SystemAdmin.php index faa3e3d..2388e8a 100644 --- a/app/admin/model/SystemAdmin.php +++ b/app/admin/model/SystemAdmin.php @@ -30,7 +30,7 @@ class SystemAdmin extends TimeModel public function getAuthList(): array { - return (new SystemAuth())->removeOption('where')->where('status', 1)->column('title', 'id'); + return (new SystemAuth())->removeOption()->where('status', 1)->column('title', 'id'); } } \ No newline at end of file diff --git a/app/admin/model/SystemMenu.php b/app/admin/model/SystemMenu.php index e651cfb..d34344e 100644 --- a/app/admin/model/SystemMenu.php +++ b/app/admin/model/SystemMenu.php @@ -25,7 +25,7 @@ class SystemMenu extends TimeModel */ public function getPidMenuList(): array { - $list = $this->removeOption('where')->field('id,pid,title')->where([ + $list = $this->removeOption()->field('id,pid,title')->where([ ['pid', '<>', MenuConstant::HOME_PID], ['status', '=', 1], ])->select()->toArray(); diff --git a/app/admin/model/SystemNode.php b/app/admin/model/SystemNode.php index 3b20375..9b60aae 100644 --- a/app/admin/model/SystemNode.php +++ b/app/admin/model/SystemNode.php @@ -9,7 +9,7 @@ class SystemNode extends TimeModel public function getNodeTreeList(): array { - $list = $this->removeOption('where')->select()->toArray(); + $list = $this->removeOption()->select()->toArray(); return $this->buildNodeTree($list); }