mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Adding NOT query conditions fix for Ticket #1793
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4167 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a420c70c91
commit
2ea8e4edee
1 changed files with 2 additions and 2 deletions
|
@ -1349,14 +1349,14 @@ class DboSource extends DataSource {
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$data = null;
|
$data = null;
|
||||||
$out = array();
|
$out = array();
|
||||||
$bool = array('and', 'or', 'and not', 'or not', 'xor', '||', '&&');
|
$bool = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&');
|
||||||
$join = ' AND ';
|
$join = ' AND ';
|
||||||
|
|
||||||
foreach($conditions as $key => $value) {
|
foreach($conditions as $key => $value) {
|
||||||
if (in_array(strtolower(trim($key)), $bool)) {
|
if (in_array(strtolower(trim($key)), $bool)) {
|
||||||
$join = ' ' . strtoupper($key) . ' ';
|
$join = ' ' . strtoupper($key) . ' ';
|
||||||
$value = $this->conditionKeysToString($value);
|
$value = $this->conditionKeysToString($value);
|
||||||
if (strpos($join, 'NOT')) {
|
if (strpos($join, 'NOT') !== false) {
|
||||||
$out[] = 'NOT (' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
$out[] = 'NOT (' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
||||||
} else {
|
} else {
|
||||||
$out[] = '(' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
$out[] = '(' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
||||||
|
|
Loading…
Add table
Reference in a new issue