Index: joomla/components/com_vxc/models/orders.php =================================================================== diff -u -r1 -r2 --- joomla/components/com_vxc/models/orders.php (.../orders.php) (revision 1) +++ joomla/components/com_vxc/models/orders.php (.../orders.php) (revision 2) @@ -32,6 +32,15 @@ $this->filter_order_Dir = 'desc'; $this->searchcustomerreference = $mainframe->getUserStateFromRequest( "$option.$view.searchcustomerreference", 'searchcustomerreference', '', 'string' ); + if ( $this->searchcustomerreference[0] === '>' ) + { + $this->acc_search_fast = True; + $this->searchcustomerreference = substr($this->searchcustomerreference,1); + } + else + { + $this->acc_search_fast = False; + } $this->searchcustomerreference = JString::strtolower( $this->searchcustomerreference ); $this->searchkind = $mainframe->getUserStateFromRequest( "$option.$view.searchkind", 'searchkind', 'MYUSER', 'string' ); @@ -142,9 +151,18 @@ " OR (LOWER(CONCAT_WS(' ',c.name,c.middlename,c.surname)) LIKE ".$this->_db->Quote('%'.$this->searchcustomerreference.'%').')'; if ($newMode) - $cond .=" OR (LOWER(CONCAT_WS(' ',atfirst.value,atmiddle.value,atlast.value)) LIKE ".$this->_db->Quote('%'.$this->searchcustomerreference.'%').')'; + { + if ( $this->acc_search_fast ) + { + $cond =" LOWER(atlast.value) LIKE ".$this->_db->Quote('%'.$this->searchcustomerreference.'%'); + } + else + { + $cond .=" OR (LOWER(CONCAT_WS(' ',atfirst.value,atmiddle.value,atlast.value)) LIKE ".$this->_db->Quote('%'.$this->searchcustomerreference.'%').')'; + $cond .= ')'; + } + } - $cond .= ')'; $where[] = $cond; }