From: Edward Date: Thu, 8 Nov 2018 06:34:04 +0000 (+0800) Subject: DataObjects/Core_company.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=1689fb54b8c20474357c627839c2109ec0febc28 DataObjects/Core_company.php --- diff --git a/DataObjects/Core_company.php b/DataObjects/Core_company.php index d6c27872..d352d558 100644 --- a/DataObjects/Core_company.php +++ b/DataObjects/Core_company.php @@ -104,13 +104,14 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject ) as comptype_display_name "); - if(!empty($q['query']['name'])){ - $s = $this->escape($q['query']['name']); + 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(!empty($q['search']['name'])){ + if(){ $s = $this->escape($q['search']['name']); $this->whereAdd(" {$tn}.name LIKE '%$s%'