From bbab04b2bc4aa4b41fa3a4969694e6c19052d0f7 Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 18 May 2017 16:34:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=9F=BA=E7=A1=80=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/controller/BasicAdmin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/controller/BasicAdmin.php b/extend/controller/BasicAdmin.php index a557071d6..512d6882c 100644 --- a/extend/controller/BasicAdmin.php +++ b/extend/controller/BasicAdmin.php @@ -59,9 +59,9 @@ class BasicAdmin extends Controller { * @param array $data 扩展数据 * @return array|string */ - protected function _form($dbQuery = null, $tplFile = '', $pkField = null, $where = [], $data = []) { + protected function _form($dbQuery = null, $tplFile = '', $pkField = '', $where = [], $data = []) { $db = is_null($dbQuery) ? Db::name($this->table) : (is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery); - $pk = is_null($pkField) ? ($db->getPk() ? $db->getPk() : 'id') : $pkField; + $pk = empty($pkField) ? ($db->getPk() ? $db->getPk() : 'id') : $pkField; $pkValue = $this->request->request($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : null)); // POST请求, 数据自动存库 if ($this->request->isPost()) {