fix #315, 实现多词自动搜索
This commit is contained in:
parent
58374261f4
commit
b6b9777f91
|
@ -114,8 +114,10 @@ class ServiceController extends Zend_Controller_Action
|
|||
//$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>?";
|
||||
if (!empty($key)) {
|
||||
$sql.= " and (title ilike ? or description ilike ?)";
|
||||
$sql.= " order by title";
|
||||
$search=new Search($key);
|
||||
$where=$search->sql_expr(array("title","description"));
|
||||
$sql.= " and ".$where;
|
||||
$sql.= " order by title";
|
||||
$rows=$this->db->fetchAll($sql,array($e,$w,$n,$s,'%'.$key.'%','%'.$key.'%'));
|
||||
} else {
|
||||
$sql.= " order by title limit 10";
|
||||
|
|
Loading…
Reference in New Issue