From 4740c66768e1ba7b1ba88054aeaf882729ed2882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 17 Oct 2022 11:37:42 +0800 Subject: [PATCH] Update Base.php --- app/admin/controller/Base.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index d88d3f55d..ef5ec317b 100644 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -75,13 +75,13 @@ class Base extends Controller if ($this->request->isGet()) { $this->types = SystemBase::types(); $this->types[] = '--- 新增类型 ---'; - $this->type = input('get.type') ?: ($this->types[0] ?? '-'); + $this->type = $this->get['type'] ?? ($this->types[0] ?? '-'); } else { $map = []; $map[] = ['deleted', '=', 0]; $map[] = ['code', '=', $data['code']]; $map[] = ['type', '=', $data['type']]; - if (isset($data['id'])) $map[] = ['id', '<>', $data['id']]; + $map[] = ['id', '<>', $data['id'] ?? 0]; if (SystemBase::mk()->where($map)->count() > 0) { $this->error("同类型的数据编码已经存在!"); }