From 1c7e73ca9ec6adf9c55ed9adf800c2dcca4f28d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= Date: Sun, 23 Jan 2022 20:52:23 +0100 Subject: [PATCH] Fix advanced search * fix is/is not empty * fix is null/is not null --- application/controllers/Search.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/controllers/Search.php b/application/controllers/Search.php index 7f11437b..f440e2cd 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -196,33 +196,33 @@ class Search extends CI_Controller { if ($object['operator'] == "is_empty") { if ($condition == "AND") { - $this->db->where($object['field'], "''"); + $this->db->where($object['field'], ''); } else { - $this->db->or_where($object['field'], "''"); + $this->db->or_where($object['field'], ''); } } if ($object['operator'] == "is_not_empty") { if ($condition == "AND") { - $this->db->where($object['field'] . ' !=', "''"); + $this->db->where($object['field'] . ' !=', ''); } else { - $this->db->or_where($object['field'] . ' !=', "''"); + $this->db->or_where($object['field'] . ' !=', ''); } } if ($object['operator'] == "is_null") { if ($condition == "AND") { - $this->db->where($object['field'] . ' is ', NULL); + $this->db->where($object['field'] . ' IS NULL'); } else { - $this->db->or_where($object['field'] . ' is ', NULL); + $this->db->or_where($object['field'] . ' IS NULL'); } } if ($object['operator'] == "is_not_null") { if ($condition == "AND") { - $this->db->where($object['field'] . ' is not ', NULL); + $this->db->where($object['field'] . ' IS NOT NULL'); } else { - $this->db->or_where($object['field'] . ' is not ', NULL); + $this->db->or_where($object['field'] . ' IS NOT NULL'); } }