mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56: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;
|
||||
$data = null;
|
||||
$out = array();
|
||||
$bool = array('and', 'or', 'and not', 'or not', 'xor', '||', '&&');
|
||||
$bool = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&');
|
||||
$join = ' AND ';
|
||||
|
||||
foreach($conditions as $key => $value) {
|
||||
if (in_array(strtolower(trim($key)), $bool)) {
|
||||
$join = ' ' . strtoupper($key) . ' ';
|
||||
$value = $this->conditionKeysToString($value);
|
||||
if (strpos($join, 'NOT')) {
|
||||
if (strpos($join, 'NOT') !== false) {
|
||||
$out[] = 'NOT (' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
||||
} else {
|
||||
$out[] = '(' . join(') ' . strtoupper($key) . ' (', $value) . ')';
|
||||
|
|
Loading…
Add table
Reference in a new issue