From 79bdc2fd9abdc6c78defeacccb75e8fe7b125ca8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 13 Sep 2016 17:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3EXP=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Builder.php | 2 +- library/think/response/Redirect.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/library/think/db/Builder.php b/library/think/db/Builder.php index a18332a2..b2d6fd1a 100644 --- a/library/think/db/Builder.php +++ b/library/think/db/Builder.php @@ -297,7 +297,7 @@ abstract class Builder } } $bindType = isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR; - if (is_scalar($value) && array_key_exists($field, $binds) && !in_array($exp, ['NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) { + if (is_scalar($value) && array_key_exists($field, $binds) && !in_array($exp, ['EXP', 'NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) { if (strpos($value, ':') !== 0 || !$this->query->isBind(substr($value, 1))) { $bindName = $bindName ?: 'where_' . $field; $this->query->bind($bindName, $value, $bindType); diff --git a/library/think/response/Redirect.php b/library/think/response/Redirect.php index ae6084c4..81b7b050 100644 --- a/library/think/response/Redirect.php +++ b/library/think/response/Redirect.php @@ -42,6 +42,24 @@ class Redirect extends Response return; } + /** + * 重定向传值(通过Session) + * @access protected + * @param string|array $name 变量名或者数组 + * @param mixed $value 值 + * @return $this + */ + public function with($name, $value = null) + { + if (is_array($name)) { + foreach ($name as $key => $val) { + Session::set($key, $val); + } + } else { + Session::set($name, $value); + } + } + /** * 获取跳转地址 * @return string