From ff16a4521d220d769d8c715b401ecf79c4b8bb49 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 20 Jun 2016 08:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB=E7=9A=84para?= =?UTF-8?q?m=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/zh-cn.php | 1 + library/think/Request.php | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lang/zh-cn.php b/lang/zh-cn.php index 978adb56..9a92c17a 100644 --- a/lang/zh-cn.php +++ b/lang/zh-cn.php @@ -45,6 +45,7 @@ return [ 'fields not exists' => '数据表字段不存在', 'where express error' => '查询表达式错误', 'no data to update' => '没有任何数据需要更新', + 'miss data to insert' => '缺少需要写入的数据', 'miss complex primary data' => '缺少复合主键数据', 'miss update condition' => '缺少更新条件', 'model data Not Found' => '模型数据不存在', diff --git a/library/think/Request.php b/library/think/Request.php index f3b86152..83ea17e8 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -559,9 +559,10 @@ class Request * @access public * @param string|array $name 变量名 * @param mixed $default 默认值 + * @param string|array $filter 过滤方法 * @return mixed */ - public function param($name = '', $default = null) + public function param($name = '', $default = null, $filter = null) { if(is_array($name)){ // 设置param @@ -587,11 +588,7 @@ class Request // 当前请求参数和URL地址中的参数合并 $this->param = array_merge($this->get(), $vars); } - if ($name) { - return isset($this->param[$name]) ? $this->param[$name] : $default; - } else { - return $this->param; - } + return $this->input($this->param, $name, $default, $filter); } /**