fix parameter error in search action

This commit is contained in:
wlx 2013-03-06 08:44:26 +00:00
parent c91f2d2bea
commit f2bdd1affc
1 changed files with 3 additions and 3 deletions

View File

@ -114,11 +114,11 @@ class ServiceController extends Zend_Controller_Action
//$end=$this->_request->getParam('end'); //$end=$this->_request->getParam('end');
$sql="select id,title,uuid,substring(description for 400) as description,filesize,fileformat from normalmetadata where east<? and west>? and north<? and south>?"; $sql="select id,title,uuid,substring(description for 400) as description,filesize,fileformat from normalmetadata where east<? and west>? and north<? and south>?";
if (!empty($key)) { if (!empty($key)) {
$search=new Search($key); $search=new SimpleSearch($key);
$where=$search->sql_expr(array("title","description")); $where=$search->sql_expr(array("title","description"));
$sql.= " and ".$where; $sql.= " and ".$where;
$sql.= " order by title"; $sql.= " order by title";
$rows=$this->db->fetchAll($sql,array($e,$w,$n,$s,'%'.$key.'%','%'.$key.'%')); $rows=$this->db->fetchAll($sql,array($e,$w,$n,$s));
} else { } else {
$sql.= " order by title limit 10"; $sql.= " order by title limit 10";
$rows=$this->db->fetchAll($sql,array($e,$w,$n,$s)); $rows=$this->db->fetchAll($sql,array($e,$w,$n,$s));