Skip to content

Commit

Permalink
Merge pull request #13 from fearoff/master
Browse files Browse the repository at this point in the history
hello there. not in operand++
  • Loading branch information
aak74 authored Jan 25, 2019
2 parents ab5adc3 + 2d661b3 commit 3a66b49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Element/QuerySet.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ private function getExpression($fieldName, $fieldValue, $prefix = '')
);
switch ($operand) {
case 'IN':
case 'NOT IN':
$values = '';
foreach ($fieldValue as $value) {
$values .= "'$value',";
}
return "`$this->tableName`.`$fieldName` IN ({$this->removeLastComma($values)}) AND ";
return "`$this->tableName`.`$fieldName` $operand ({$this->removeLastComma($values)}) AND ";
break;
case 'BETWEEN':
return "`$this->tableName`.`$fieldName` BETWEEN '{$fieldValue[0]}' AND '{$fieldValue[1]}' AND ";
Expand All @@ -163,6 +164,9 @@ private function getOperand($fieldValue, $prefix = '')
if ($prefix == '><') {
return 'BETWEEN';
}
if ($prefix == '!=') {
return 'NOT IN';
}
return 'IN';
}
// \Akop\Util::pre([$fieldValue, $prefix], 'getOperand');
Expand Down

0 comments on commit 3a66b49

Please sign in to comment.