From 4a52aabd15485e6c047238372142aaae9609dbb8 Mon Sep 17 00:00:00 2001 From: Han Lin Yap Date: Tue, 27 Dec 2011 11:34:15 +0100 Subject: [PATCH 1/2] Fix bug when using raw_where with eloquent --- laravel/database/grammars/grammar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/database/grammars/grammar.php b/laravel/database/grammars/grammar.php index aa7b8648..54b50616 100644 --- a/laravel/database/grammars/grammar.php +++ b/laravel/database/grammars/grammar.php @@ -217,12 +217,12 @@ protected function where_not_null($where) /** * Compile a raw WHERE clause. * - * @param string $where + * @param array $where * @return string */ protected function where_raw($where) { - return $where; + return $where['sql']; } /** From 4b3965e46194d50d5ae59f4985fed3cb61869aeb Mon Sep 17 00:00:00 2001 From: Han Lin Yap Date: Tue, 27 Dec 2011 11:35:37 +0100 Subject: [PATCH 2/2] Fix bug when using raw_where with eloquent --- laravel/database/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/query.php b/laravel/database/query.php index 76928792..93364675 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -175,7 +175,7 @@ public function reset_where() */ public function raw_where($where, $bindings = array(), $connector = 'AND') { - $this->wheres[] = array('type' => 'raw', 'connector' => $connector, 'sql' => $where); + $this->wheres[] = array('type' => 'where_raw', 'connector' => $connector, 'sql' => $where); $this->bindings = array_merge($this->bindings, $bindings);