From b1742361d0836b7f6ee360d40a35c4af559aeecb Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 10 Sep 2016 10:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Route=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 0acd4ed6..dfbb5b81 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1348,7 +1348,6 @@ class Route $model = $val; $exception = true; } - $model = strpos($model, '\\') ? $model : Loader::model($model); $where = []; $match = true; foreach ($fields as $field) { @@ -1360,7 +1359,8 @@ class Route } } if ($match) { - $result = $model::where($where)->failException($exception)->find(); + $query = strpos($model, '\\') ? $model::where($where) : Loader::model($model)->where($where); + $result = $query->failException($exception)->find(); } } if (!empty($result)) {