From 763df0b8dda86bd399bc6dcd301d00e03406df73 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 17 Nov 2021 17:17:17 +0100 Subject: [PATCH] [Advanced Search] This fix adds table name to column so that query doesn't error --- application/controllers/Search.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controllers/Search.php b/application/controllers/Search.php index 50de2354..33bc1cdc 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -149,7 +149,6 @@ class Search extends CI_Controller { if(is_array($value)) { foreach($value as $values) { - if(isset($values['rules'])) { if($values['condition'] == "AND") { $this->db->group_start(); @@ -158,6 +157,8 @@ class Search extends CI_Controller { } foreach($values['rules'] as $group_value) { + $group_value['field'] = $this->config->item('table_name') . '.' . $group_value['field']; + if($group_value['operator'] == "equal") { if($values['condition'] == "AND") { $this->db->where($group_value['field'], $group_value['value']); @@ -267,6 +268,8 @@ class Search extends CI_Controller { $this->db->group_end(); } else { //print_r($values['field']); + $values['field'] = $this->config->item('table_name') . '.' . $values['field']; + if(isset($values['operator'])) { }