change knowledge content
This commit is contained in:
parent
44e0f00dc7
commit
c1928b5c24
|
@ -7,7 +7,7 @@ class HiwaterController extends DataController
|
||||||
{
|
{
|
||||||
parent::preDispatch();
|
parent::preDispatch();
|
||||||
//$this->_helper->layout->setLayout('hiwater');
|
//$this->_helper->layout->setLayout('hiwater');
|
||||||
$this->debug = 1;
|
$this->debug = 0;
|
||||||
$acName = $this->_request->getActionName();
|
$acName = $this->_request->getActionName();
|
||||||
if(in_array($acName,array("aviation","radiometer","lidar","ccdlidar","widas",'ccdwidas',"nearvis","thermal")))
|
if(in_array($acName,array("aviation","radiometer","lidar","ccdlidar","widas",'ccdwidas',"nearvis","thermal")))
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ class KnowledgeController extends Zend_Controller_Action
|
||||||
function datacenterAction()
|
function datacenterAction()
|
||||||
{
|
{
|
||||||
$siteid="e31f5ea7-a4af-4ae3-9ac1-1a84132c4338";//site uuid from geonetowrk
|
$siteid="e31f5ea7-a4af-4ae3-9ac1-1a84132c4338";//site uuid from geonetowrk
|
||||||
$sql="select * from mdref mr left join reference r on mr.refid=r.id where mr.uuid=? order by r.id desc";
|
$sql="select r.* from mdref mr left join reference r on mr.refid=r.id where r.language<>'zh' and mr.uuid=? order by r.id desc";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute(array($siteid));
|
$sth->execute(array($siteid));
|
||||||
$rows = $sth->fetchAll();
|
$rows = $sth->fetchAll();
|
||||||
|
@ -26,22 +26,10 @@ class KnowledgeController extends Zend_Controller_Action
|
||||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||||
$this->view->paginator=$paginator;
|
$this->view->paginator=$paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
function userAction()
|
function userAction()
|
||||||
{
|
{
|
||||||
$sql="select * from reference where id in (select refid from mdref where reftype=1 and uuid in (select uuid from normalmetadata)) order by id desc";
|
$sql="select * from reference where language<>'zh' and id in (select refid from mdref where reftype=1 and uuid in (select uuid from en.normalmetadata)) order by id desc";
|
||||||
$sth = $this->db->prepare($sql);
|
|
||||||
$sth->execute();
|
|
||||||
$rows = $sth->fetchAll();
|
|
||||||
$paginator = Zend_Paginator::factory($rows);
|
|
||||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
|
||||||
$paginator->setItemCountPerPage(10);
|
|
||||||
$paginator->setView($this->view);
|
|
||||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
|
||||||
$this->view->paginator=$paginator;
|
|
||||||
}
|
|
||||||
function authorAction()
|
|
||||||
{
|
|
||||||
$sql="select * from reference where id in (select refid from mdref where reftype=0 and uuid in (select uuid from normalmetadata)) order by id desc";
|
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$rows = $sth->fetchAll();
|
$rows = $sth->fetchAll();
|
||||||
|
@ -53,9 +41,26 @@ class KnowledgeController extends Zend_Controller_Action
|
||||||
$this->view->paginator=$paginator;
|
$this->view->paginator=$paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
function westplanAction()
|
function authorAction()
|
||||||
{
|
{
|
||||||
$sql="select distinct array_to_string(array(select author from knl_author t where t.item_id=c.item_id order by place asc),'; ') as author,c.title,c.publisher,c.ts_created,c.ts_issued,c.item_id,c.url from knl_article c where c.url <>'' order by ts_created desc";
|
$sql="select * from reference where language<>'zh' and id in (select refid from mdref where reftype=0 and uuid in (select uuid from en.normalmetadata)) order by id desc";
|
||||||
|
$sth = $this->db->prepare($sql);
|
||||||
|
$sth->execute();
|
||||||
|
$rows = $sth->fetchAll();
|
||||||
|
$paginator = Zend_Paginator::factory($rows);
|
||||||
|
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||||
|
$paginator->setItemCountPerPage(10);
|
||||||
|
$paginator->setView($this->view);
|
||||||
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||||
|
$this->view->paginator=$paginator;
|
||||||
|
}
|
||||||
|
|
||||||
|
function waterAction()
|
||||||
|
{
|
||||||
|
$sql="select * from reference where language<>'zh' and id in
|
||||||
|
(select refid from mdref where uuid in
|
||||||
|
(select m.uuid from en.normalmetadata m left join datasource ds on ds.uuid=m.uuid left join source s on ds.sourceid=s.id where s.code='water'))
|
||||||
|
order by id desc";
|
||||||
$sth = $this->db->prepare($sql);
|
$sth = $this->db->prepare($sql);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$rows = $sth->fetchAll();
|
$rows = $sth->fetchAll();
|
||||||
|
@ -86,7 +91,7 @@ class KnowledgeController extends Zend_Controller_Action
|
||||||
$key=preg_replace($patterns, $replacements, $key);
|
$key=preg_replace($patterns, $replacements, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($key) && $source=='datasource') {
|
if (!empty($key)) {
|
||||||
$search=new SimpleSearch($key);
|
$search=new SimpleSearch($key);
|
||||||
$where=$search->sql_expr(array("reference"));
|
$where=$search->sql_expr(array("reference"));
|
||||||
$sql="select * from reference where ".$where." order by id desc";
|
$sql="select * from reference where ".$where." order by id desc";
|
||||||
|
@ -103,23 +108,6 @@ class KnowledgeController extends Zend_Controller_Action
|
||||||
$this->view->source=$source;
|
$this->view->source=$source;
|
||||||
$this->_helper->viewRenderer('search-data');
|
$this->_helper->viewRenderer('search-data');
|
||||||
}
|
}
|
||||||
else if (!empty($key) && $source=='westsource') {
|
|
||||||
$search=new SimpleSearch($key);
|
|
||||||
$where=$search->sql_expr(array("c.title","a.author"));
|
|
||||||
$sql="select distinct a.author,c.title,c.publisher,c.ts_created,c.ts_issued,c.item_id,c.url from knl_article c left join knl_author a on c.item_id=a.item_id where c.url <>'' and a.place=1 and $where order by ts_created desc";
|
|
||||||
$sth = $this->db->prepare($sql);
|
|
||||||
$sth->execute();
|
|
||||||
$rows = $sth->fetchAll();
|
|
||||||
$paginator = Zend_Paginator::factory($rows);
|
|
||||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
|
||||||
$paginator->setItemCountPerPage(10);
|
|
||||||
$paginator->setView($this->view);
|
|
||||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
|
||||||
$this->view->paginator=$paginator;
|
|
||||||
$this->view->key=$key;
|
|
||||||
$this->view->source=$source;
|
|
||||||
//$this->_helper->viewRenderer('search-data');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function paperAction()
|
function paperAction()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue