mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Request类的param方法
This commit is contained in:
@@ -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' => '模型数据不存在',
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user