[*] add logic into createWhere method

This commit is contained in:
rsgrinko committed 2021-12-10 09:02:23 +03:00
1 parent 7ba182e0cf
commit 8228fae384
1 file changed
+2 -2
+2 -2
View File
@@ -81,7 +81,7 @@ class CDB
* @param $where * @param $where
* @return false|mixed|string * @return false|mixed|string
*/ */
private function createWhere($where) private function createWhere($where, $logic = 'AND')
{ {
if (!is_array($where)) { if (!is_array($where)) {
return $where; return $where;
@@ -103,7 +103,7 @@ class CDB
} else { } else {
$symbol = '='; $symbol = '=';
} }
$where_string = $where_string . ' (' . $where_key . $symbol . '\'' . $where_item . '\') AND'; $where_string = $where_string . ' (' . $where_key . $symbol . '\'' . $where_item . '\') '.$logic;
} }
$where_string = substr($where_string, 0, -4); $where_string = substr($where_string, 0, -4);