add hot and latest action in search
This commit is contained in:
parent
42db7897d2
commit
a7b2365317
|
@ -40,6 +40,33 @@ class SearchController extends Zend_Controller_Action
|
|||
header("Content-Type: application/json; charset=utf-8");
|
||||
echo $search->suggest($q);
|
||||
}
|
||||
|
||||
function hotAction()
|
||||
{
|
||||
$sql="select m.uuid,title from normalmetadata m left join mdstat s on m.uuid=s.uuid order by s.viewed desc limit 10";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth ->execute();
|
||||
$rows = $sth->fetchAll();
|
||||
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
header("Content-Type: application/json; charset=utf-8");
|
||||
echo json_encode($rows);;
|
||||
}
|
||||
|
||||
function latestAction()
|
||||
{
|
||||
$sql="select uuid,title from normalmetadata order by ts_created desc limit 10";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth ->execute();
|
||||
$rows = $sth->fetchAll();
|
||||
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
header("Content-Type: application/json; charset=utf-8");
|
||||
echo json_encode($rows);;
|
||||
}
|
||||
|
||||
function advanceAction()
|
||||
{
|
||||
$this->view->east=$this->getParam('east');
|
||||
|
|
Loading…
Reference in New Issue