Add NOT IN operator
This commit is contained in:
@@ -586,7 +586,8 @@ class Db extends PhpObject
|
|||||||
{
|
{
|
||||||
if(is_array($asConstraints))
|
if(is_array($asConstraints))
|
||||||
{
|
{
|
||||||
if(array_key_exists('constOpe', $asInfo) && array_key_exists($sField, $asInfo['constOpe']) && $asInfo['constOpe'][$sField]=='BETWEEN') {
|
$sConstOpe = $asInfo['constOpe'][$sField] ?? '';
|
||||||
|
if($sConstOpe == 'BETWEEN') {
|
||||||
//Between
|
//Between
|
||||||
$asSelection[$sField] = $asConstraints['from'].' AND '.$asConstraints['to'];
|
$asSelection[$sField] = $asConstraints['from'].' AND '.$asConstraints['to'];
|
||||||
$asInfo['constOpe'][$sField] = " BETWEEN ";
|
$asInfo['constOpe'][$sField] = " BETWEEN ";
|
||||||
@@ -594,7 +595,7 @@ class Db extends PhpObject
|
|||||||
else {
|
else {
|
||||||
//Multiple values (IN)
|
//Multiple values (IN)
|
||||||
$asSelection[$sField] = "(".implode(', ', $asConstraints).")";
|
$asSelection[$sField] = "(".implode(', ', $asConstraints).")";
|
||||||
$asInfo['constOpe'][$sField] = " IN ";
|
$asInfo['constOpe'][$sField] = ($sConstOpe=='NOT IN')?" NOT IN ":" IN ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif(!array_key_exists('constOpe', $asInfo) || !array_key_exists($sField, $asInfo['constOpe'])) $asInfo['constOpe'][$sField] = " = ";
|
elseif(!array_key_exists('constOpe', $asInfo) || !array_key_exists($sField, $asInfo['constOpe'])) $asInfo['constOpe'][$sField] = " = ";
|
||||||
|
|||||||
Reference in New Issue
Block a user