aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/SearchController.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers/SearchController.php')
-rw-r--r--h-source/Application/Controllers/SearchController.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index 9633a0e..9e7cb68 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -60,11 +60,18 @@ class SearchController extends BaseController
if (strcmp($this->viewArgs['action'],'search') === 0)
{
Params::$whereClauseSymbolArray = array('like');
+
+ $this->m['HardwareModel']->logicalOperators = array('AND','OR');
$whereClause = array(
- 'type' => $this->viewArgs['type'],
- 'model' => "like '%".$this->viewArgs['model']."%'",
- '-deleted' => "no",
+ 'type' => $this->viewArgs['type'],
+ 'level1' => array(
+ 'model' => "like '%".$this->viewArgs['model']."%'",
+ 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ ),
+// 'model' => "like '%".$this->viewArgs['model']."%'",
+// 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ '-deleted' => "no",
);
$recordNumber = $this->m['HardwareModel']->clear()->where($whereClause)->orderBy("id_hard desc")->rowNumber();
@@ -77,7 +84,7 @@ class SearchController extends BaseController
//set the limit clause
$limit = $this->h['Pages']->getLimit($page,$recordNumber,10);
- $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
+ $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year,other_names')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
// echo $this->m['HardwareModel']->getQuery();
$data['pageList'] = $this->h['Pages']->render($page-3,7);