X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_company.php;h=abc1506921fdee29c75c40be6af41a358609524c;hp=d352d558896701e79af1d10725e539a93e852500;hb=8e71fc827cbfb25f6535986a2a2473894f510270;hpb=1689fb54b8c20474357c627839c2109ec0febc28 diff --git a/DataObjects/Core_company.php b/DataObjects/Core_company.php index d352d558..abc15069 100644 --- a/DataObjects/Core_company.php +++ b/DataObjects/Core_company.php @@ -107,18 +107,16 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject if(!empty($q['query']['name']) || !empty($q['search']['name'])){ $s = (!empty($q['query']['name'])) ? $this->escape($q['query']['name']) : $this->escape($q['search']['name']); + $this->whereAdd(" {$tn}.name LIKE '%$s%' "); } - if(){ - $s = $this->escape($q['search']['name']); - $this->whereAdd(" - {$tn}.name LIKE '%$s%' - "); - } - if(!empty($q['search']['name_starts'])){ - $s = $this->escape($q['search']['name_starts']); + + if(!empty($q['query']['name_starts']) || !empty($q['search']['name_starts'])){ + + $s = (!empty($q['query']['name_starts'])) ? $this->escape($q['query']['name_starts']) : $this->escape($q['search']['name_starts']); + $this->whereAdd(" {$tn}.name LIKE '$s%' ");