Ref #649 - Added query builder support for BETWEEN clauses
Signed-off-by: Stan Bondi <stan@stanley-pc.(none)>
This commit is contained in:
27
laravel/database/query/grammars/grammar.php
Normal file → Executable file
27
laravel/database/query/grammars/grammar.php
Normal file → Executable file
@@ -242,6 +242,33 @@ class Grammar extends \Laravel\Database\Grammar {
|
||||
return $this->wrap($where['column']).' NOT IN ('.$parameters.')';
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a WHERE BETWEEN clause
|
||||
*
|
||||
* @param array $where
|
||||
* @return string
|
||||
*/
|
||||
protected function where_between($where)
|
||||
{
|
||||
$min = $this->parameter($where['min']);
|
||||
$max = $this->parameter($where['max']);
|
||||
|
||||
return $this->wrap($where['column']).' BETWEEN '.$min.' AND '.$max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a WHERE NOT BETWEEN clause
|
||||
* @param array $where
|
||||
* @return string
|
||||
*/
|
||||
protected function where_not_between($where)
|
||||
{
|
||||
$min = $this->parameter($where['min']);
|
||||
$max = $this->parameter($where['max']);
|
||||
|
||||
return $this->wrap($where['column']).' NOT BETWEEN '.$min.' AND '.$max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a WHERE NULL clause.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user