切换normalmetadata为heihemetadata,并做页面的修改

This commit is contained in:
wlx 2013-06-20 07:34:53 +00:00
parent 7e77feb16d
commit 7ec4679db8
4 changed files with 72 additions and 87 deletions

View File

@ -26,21 +26,21 @@ class DataController extends Zend_Controller_Action
$state=$this->db->query('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh');
$this->view->category=$state->fetchAll();
//关键词
$state=$this->db->query("select keyword,count(*) from keyword where keytype='place' group by keyword order by count desc limit 20");
$state=$this->db->query("select keyword,count(*) from keyword right join heihemetadata on keyword.id=heihemetadata.id where keytype='place' group by keyword order by count desc limit 20");
$k1=$state->fetchAll();
$state=$this->db->query("select keyword,count(*) from keyword where keytype='theme' group by keyword order by count desc limit 20");
//$state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='theme' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$state=$this->db->query("select keyword,count(*) from keyword right join heihemetadata on keyword.id=heihemetadata.id where keytype='theme' group by keyword order by count desc limit 20");
//$state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join heihemetadata m on k.id=m.id where k.keytype='theme' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$k2=$state->fetchAll();
$state=$this->db->query("select keyword,count(*) from keyword where keytype='discipline' group by keyword order by count desc limit 20");
$state=$this->db->query("select keyword,count(*) from keyword right join heihemetadata on keyword.id=heihemetadata.id where keytype='discipline' group by keyword order by count desc limit 20");
$k3=$state->fetchAll();
$state=$this->db->query("select keyword,count(*) from keyword where keytype='stratum' group by keyword order by count desc limit 20");
$state=$this->db->query("select keyword,count(*) from keyword right join heihemetadata on keyword.id=heihemetadata.id where keytype='stratum' group by keyword order by count desc limit 20");
$k4=$state->fetchAll();
$state=$this->db->query("select keyword,count(*) from keyword where keytype='temporal' group by keyword order by count desc limit 20");
//$state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='temporal' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$state=$this->db->query("select keyword,count(*) from keyword right join heihemetadata on keyword.id=heihemetadata.id where keytype='temporal' group by keyword order by count desc limit 20");
//$state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join heihemetadata m on k.id=m.id where k.keytype='temporal' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$k5=$state->fetchAll();
$this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
//最新10个入库数据
$state=$this->db->query('select id,uuid,title from normalmetadata order by id desc limit 10');
$state=$this->db->query('select id,uuid,title from heihemetadata order by id desc limit 10');
$this->view->metadata = $state->fetchAll();
//特色数据
@ -87,11 +87,11 @@ class DataController extends Zend_Controller_Action
if (empty($page)) $page=1;
$limit=30;
$offset=$limit*($page-1);
$state=$this->db->query('select count(*) from normalmetadata where datatype=0');
$state=$this->db->query('select count(*) from heihemetadata where datatype=0');
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit);
$select->from('heihemetadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit);
$this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
}
@ -101,11 +101,11 @@ class DataController extends Zend_Controller_Action
if (empty($page)) $page=1;
$limit=30;
$offset=$limit*($page-1);
$state=$this->db->query('select count(*) from normalmetadata where datatype=1');
$state=$this->db->query('select count(*) from heihemetadata where datatype=1');
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit);
$select->from('heihemetadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit);
$this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
}
@ -205,7 +205,7 @@ class DataController extends Zend_Controller_Action
if (empty($page)) $page=1;
$limit=10;
$offset=$limit*($page-1);
$sql='select keyword,count(*),keytype from keyword ';
$sql='select keyword,count(*),keytype from keyword right join heihemetadata on keyword.id=heihemetadata.id ';
if (!empty($keytype) && ($keytype=='place' || $keytype=='theme' || $keytype=='discipline'||$keytype=='temporal')) $sql.=" where keytype='".$keytype."'";
$sql.=' group by keyword,keytype order by keytype,keyword,count desc';
$state=$this->db->query($sql);
@ -218,13 +218,13 @@ class DataController extends Zend_Controller_Action
$key=$row->name;
}
$this->view->codename=$key;
$sql=$this->db->quoteInto('select count(m.id) from normalmetadata m,keyword k where m.id=k.id and k.keyword=?',$key);
$sql=$this->db->quoteInto('select count(m.id) from heihemetadata m,keyword k where m.id=k.id and k.keyword=?',$key);
$state=$this->db->query($sql);
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata','*')->join('keyword','normalmetadata.id=keyword.id')->where('keyword.keyword=?',$key)->order('normalmetadata.title')->limitPage($page,$limit);
$select->from('heihemetadata','*')->join('keyword','heihemetadata.id=keyword.id')->where('keyword.keyword=?',$key)->order('heihemetadata.title')->limitPage($page,$limit);
//$sql=$db->quoteInto('select m.* from metadata m,keyword k where m.id=k.id and k.keyword=?',$key);
//$state=$db->query($sql);
$this->view->metadata=$this->db->fetchAll($select);
@ -271,17 +271,17 @@ class DataController extends Zend_Controller_Action
$this->view->codename=$row['name'];
if (!empty($keyword))
{
$sql='select count(m.id) as count from normalmetadata m,dataseries d,keyword k where m.id=d.id and m.id=k.id and d.sid=? and k.keyword=?';
$sql='select count(m.id) as count from heihemetadata m,dataseries d,keyword k where m.id=d.id and m.id=k.id and d.sid=? and k.keyword=?';
$row=$this->db->fetchAll($sql,array($id,$keyword));
$this->view->codename.="【关键词:".$keyword."";
}else{
$sql='select count(m.id) as count from normalmetadata m,dataseries d where m.id=d.id and d.sid=?';
$sql='select count(m.id) as count from heihemetadata m,dataseries d where m.id=d.id and d.sid=?';
$row=$this->db->fetchAll($sql,array($id));
}
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata','*')->join('dataseries','normalmetadata.id=dataseries.id')->where('dataseries.sid=?',$id)->order('normalmetadata.title')->limitPage($page,$limit);
if (!empty($keyword)) $select->join('keyword','keyword.id=normalmetadata.id')->where('keyword.keyword=?',$keyword);
$select->from('heihemetadata','*')->join('dataseries','heihemetadata.id=dataseries.id')->where('dataseries.sid=?',$id)->order('heihemetadata.title')->limitPage($page,$limit);
if (!empty($keyword)) $select->join('keyword','keyword.id=heihemetadata.id')->where('keyword.keyword=?',$keyword);
$this->view->metadata=$this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
//$this->view->showtools=($sum>$page)?true:false;
@ -308,11 +308,11 @@ class DataController extends Zend_Controller_Action
$where=$this->db->quoteInto('code = ?',$code);
$row=$this->db->fetchRow("select * from categorycode where ".$where);
$this->view->codename=(empty($row['name_zh'])?$row['name']:$row['name_zh']);
$sql='select count(m.id) from normalmetadata m left join category c on m.id=c.id where c.code=?';
$sql='select count(m.id) from heihemetadata m left join category c on m.id=c.id where c.code=?';
$row=$this->db->fetchRow($sql,array($code));
$sum=$row['count'];
$select=$this->db->select();
$select->from('normalmetadata as m','*')->joinLeft('category as c','m.id=c.id')->where('c.code=?',$code)->order('m.title')->limitPage($page,$this->limit);
$select->from('heihemetadata as m','*')->joinLeft('category as c','m.id=c.id')->where('c.code=?',$code)->order('m.title')->limitPage($page,$this->limit);
$this->view->metadata=$this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$this->limit);
} else {
@ -326,14 +326,14 @@ class DataController extends Zend_Controller_Action
function timelineAction()
{
$fn="time1.xml";
$rows=$this->db->fetchAll("select ts_created from normalmetadata order by ts_created desc limit 1");
$rows=$this->db->fetchAll("select ts_created from heihemetadata order by ts_created desc limit 1");
$last_update=strtotime($rows[0]['ts_created']);
if (!file_exists($fn) || (filemtime($fn)<$last_update))
{
$dateformat="M j Y";
$md = new MetadataTable();
$db=$md->getAdapter();
$state=$db->query('select id,uuid,description,title,timebegin,timeend from normalmetadata where timebegin is not null order by timebegin');
$state=$db->query('select id,uuid,description,title,timebegin,timeend from heihemetadata where timebegin is not null order by timebegin');
$rows=$state->fetchAll();
$timexml='<data>';
foreach($rows as $row) {
@ -372,7 +372,7 @@ class DataController extends Zend_Controller_Action
$id = (int)$this->_request->getParam('id');
$where='';
if (!empty($id)) { $where=' where id='.$id; }
$sql='select id,uuid,west,south,north,east,title from normalmetadata'.$where;
$sql='select id,uuid,west,south,north,east,title from heihemetadata'.$where;
$state=$db->query($sql);
$rows=$state->fetchAll();
$geomd=new GeoMetaData();
@ -396,7 +396,7 @@ class DataController extends Zend_Controller_Action
*/
function timemapAction()
{
$sql='select id,uuid,west,south,north,east,title,timebegin,timeend from normalmetadata where timebegin is not null';
$sql='select id,uuid,west,south,north,east,title,timebegin,timeend from heihemetadata where timebegin is not null';
$this->view->rows=$this->db->fetchAll($sql);
}
/*
@ -445,7 +445,7 @@ class DataController extends Zend_Controller_Action
//'generator' => 'Zend Framework Zend_Feed',
'entries' => array()
);
$sql="select * from normalmetadata order by ts_created desc";
$sql="select * from heihemetadata order by ts_created desc";
$rs=$this->db->fetchAll($sql);
$feedArray['published']=strtotime($rs[0]['ts_created']);
foreach($rs as $r)
@ -483,9 +483,9 @@ class DataController extends Zend_Controller_Action
$offset=$this->limit*($page-1);
$search=new Search($key);
$where=$search->sql_expr(array("title","description"));
$row=$this->db->fetchAll("select count(*) from normalmetadata where ".$where);
$row=$this->db->fetchAll("select count(*) from heihemetadata where ".$where);
$sum=$row[0]['count'];
$sql="select uuid,title,id,description from normalmetadata where ".$where." order by title limit ? offset ?";
$sql="select uuid,title,id,description from heihemetadata where ".$where." order by title limit ? offset ?";
$this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit);
$this->view->key=$key;
@ -519,15 +519,15 @@ class DataController extends Zend_Controller_Action
$start=$this->_request->getParam('start');
$end=$this->_request->getParam('end');
if (!empty($key)) {
$sql='select count(*) from normalmetadata where east<? and west>? and north<? and south>? and (title ilike ? or description ilike ?)';
$sql='select count(*) from heihemetadata where east<? and west>? and north<? and south>? and (title ilike ? or description ilike ?)';
$row=$db->fetchAll($sql,array($e,$w,$n,$s,'%'.$key.'%','%'.$key.'%'));
} else {
$sql='select count(*) from normalmetadata where east<? and west>? and north<? and south>?';
$sql='select count(*) from heihemetadata where east<? and west>? and north<? and south>?';
$row=$db->fetchAll($sql,array($e,$w,$n,$s));
}
$sum=$row[0]['count'];
$select=$db->select();
$select->from('normalmetadata','*')->where('east<?',$e)->where('west>?',$w)->where('north<?',$n)->where('south>?',$s);
$select->from('heihemetadata','*')->where('east<?',$e)->where('west>?',$w)->where('north<?',$n)->where('south>?',$s);
if (!empty($key)) $select->where('(title ilike ? or description ilike ?)','%'.$key.'%');
$select->order('title')->limit($limit,$offset);
$this->view->metadata = $db->fetchAll($select);
@ -542,7 +542,7 @@ class DataController extends Zend_Controller_Action
function viewAction()
{
$id = (int)$this->_request->getParam('id');
$sql="select m.*,s.status,g.id as gid,t.filename,i.doi as datadoi,i.authors,i.author_en,i.publisher,i.publisher_en, date_part('year',i.ts_published) as publish_year from normalmetadata m left join mdstatus s on m.uuid=s.uuid
$sql="select m.*,s.status,g.id as gid,t.filename,i.doi as datadoi,i.authors,i.author_en,i.publisher,i.publisher_en, date_part('year',i.ts_published) as publish_year from heihemetadata m left join mdstatus s on m.uuid=s.uuid
left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid left join datadoi i on i.uuid=m.uuid where ";
if (empty($id)) {
$uuid = $this->_request->getParam('uuid');
@ -636,7 +636,7 @@ class DataController extends Zend_Controller_Action
$sql.=" 1<>1) order by a.ts_created desc limit 10";
$this->view->literature=$this->db->fetchAll($sql);
//相关元数据,根据同名关键词实现
$sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
$sql="select distinct(md.uuid),md.title from keyword kw left join heihemetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
$this->view->related=$this->db->fetchAll($sql,array($id,$id));
//用户下载记录
$sql = "select o.ts_created,m.uuid,u.realname,u.unit,oa.project as onlineproject, fa.project as offlineproject
@ -1480,7 +1480,7 @@ class DataController extends Zend_Controller_Action
$sql="select count(*) as datacount from dataorder where (ts_approved is null) and userid='$userid' and uuid=? and status in (1,2,3,4)";
$r1=$this->db->fetchRow($this->db->quoteInto($sql,$uuid));
//保证添加的离线数据是正式发布的数据
$sql="select count(*) as mdcount from normalmetadata where uuid=?";
$sql="select count(*) as mdcount from heihemetadata where uuid=?";
$r2=$this->db->fetchRow($this->db->quoteInto($sql,$uuid));
if ($r['datacount']<$this->view->config->download->max && $r1['datacount']<1 && $r2['mdcount']>0) {
$sql="insert into dataorder (uuid,ts_created,userid,status) values(?,now(),?,?)";
@ -1710,11 +1710,11 @@ class DataController extends Zend_Controller_Action
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$offset=$this->limit*($page-1);
$state=$this->db->query("select count(*) from normalmetadata");
$state=$this->db->query("select count(*) from heihemetadata");
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata as m','m.*')
$select->from('heihemetadata as m','m.*')
->order('m.title desc')->limitPage($page,9);
$this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$this->limit);
@ -1858,7 +1858,7 @@ class DataController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$sql="select title,datatype,filesize,id from normalmetadata";
$sql="select title,datatype,filesize,id from heihemetadata";
$md=$this->db->fetchAll($sql);
foreach($md as $m)
{
@ -1891,7 +1891,7 @@ class DataController extends Zend_Controller_Action
$this->view->organisation=$state->fetchAll();
if (!empty($name)) {
$this->view->codename=$name;
$sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.role in ('pointOfContact','resourceProvider','owner') and s.organisation=?";
$sql="select distinct m.* from heihemetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.role in ('pointOfContact','resourceProvider','owner') and s.organisation=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($name));
$rows = $sth->fetchAll();
@ -1912,7 +1912,7 @@ class DataController extends Zend_Controller_Action
$sql="select * from fund where id=?";
$this->view->fund=$this->db->fetchRow($sql,array($id));
if ($this->view->fund) {
$sql="select distinct m.* from normalmetadata m left join mdfund mf on m.uuid=mf.uuid where mf.fid=?";
$sql="select distinct m.* from heihemetadata m left join mdfund mf on m.uuid=mf.uuid where mf.fid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($id));
$rows = $sth->fetchAll();
@ -1945,23 +1945,23 @@ class DataController extends Zend_Controller_Action
$ac = $this->_request->getParam('ac');
if ($ac=='unready') {
//列出没有DOI的数据
$sql="select m.* from normalmetadata m where length(m.doi)<3 and m.uuid not in (select uuid from datadoi) order by m.ts_created desc";
$sql="select m.* from heihemetadata m where length(m.doi)<3 and m.uuid not in (select uuid from datadoi) order by m.ts_created desc";
$this->view->pageID='doi-unready';
} else if ($ac=='prepare') {
//列出有DOI但还未进行提交申请的数据
$sql="select m.* from normalmetadata m where length(m.doi)>3 and m.uuid not in (select uuid from datadoi) order by m.ts_created desc";
$sql="select m.* from heihemetadata m where length(m.doi)>3 and m.uuid not in (select uuid from datadoi) order by m.ts_created desc";
$this->view->pageID='doi-prepare';
} else if ($ac=='unsubmit') {
//列出有DOI并计划提交申请的数据
$sql="select m.*,d.doi as datadoi,date(d.ts_created) as ts_created from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_created is not null and d.ts_submitted is null order by d.ts_created desc";
$sql="select m.*,d.doi as datadoi,date(d.ts_created) as ts_created from heihemetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_created is not null and d.ts_submitted is null order by d.ts_created desc";
$this->view->pageID='doi-unsubmit';
} else if ($ac=='submit') {
//列出有DOI并计划提交申请的数据
$sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_submitted is not null and d.ts_published is null order by d.ts_submitted desc,d.ts_created desc";
$sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted from heihemetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_submitted is not null and d.ts_published is null order by d.ts_submitted desc,d.ts_created desc";
$this->view->pageID='doi-submit';
} else if ($ac=='publish' || empty($ac)) {
//默认列出最新发布的DOI数据
$sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted,date(d.ts_published) as ts_published from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_published is not null order by d.ts_published desc,d.ts_submitted desc,d.ts_created desc";
$sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted,date(d.ts_published) as ts_published from heihemetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_published is not null order by d.ts_published desc,d.ts_submitted desc,d.ts_created desc";
$this->view->pageID='doi-publish';
}
$sth = $this->db->prepare($sql);
@ -1988,7 +1988,7 @@ class DataController extends Zend_Controller_Action
//列出作者的数据
$sql="select username,realname from users where id=?";
$this->view->author=$this->db->fetchRow($sql,array($id));
$sql="select m.* from normalmetadata m left join mdauthor a on a.uuid=m.uuid where a.userid=?";
$sql="select m.* from heihemetadata m left join mdauthor a on a.uuid=m.uuid where a.userid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($id));
$rows = $sth->fetchAll();
@ -2000,7 +2000,7 @@ class DataController extends Zend_Controller_Action
$this->view->paginator=$paginator;
} else {
//已经认证过的数据作者
$sql="select u.username,u.realname,u.id,count(u.id) as count from mdauthor a left join users u on a.userid=u.id where a.status=1 and a.uuid in (select uuid from normalmetadata) group by u.id,u.username,u.realname";
$sql="select u.username,u.realname,u.id,count(u.id) as count from mdauthor a left join users u on a.userid=u.id where a.status=1 and a.uuid in (select uuid from heihemetadata) group by u.id,u.username,u.realname";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
@ -2019,7 +2019,7 @@ class DataController extends Zend_Controller_Action
//列出数据
$sql="select individual as username from responsible where id=?";
$this->view->author=$this->db->fetchRow($sql,array($id));
$sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.role in ('pointOfContact','resourceProvider','owner') and s.id=?";
$sql="select distinct m.* from heihemetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.role in ('pointOfContact','resourceProvider','owner') and s.id=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($id));
$rows = $sth->fetchAll();
@ -2047,7 +2047,7 @@ class DataController extends Zend_Controller_Action
function listAction()
{
$sql="select m.uuid,m.title,m.citation,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year from normalmetadata m
$sql="select m.uuid,m.title,m.citation,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year from heihemetadata m
left join mdstatus s on m.uuid=s.uuid
left join datadoi d on d.uuid=m.uuid
where s.status>4
@ -2057,16 +2057,16 @@ where s.code in ('heihe','water','hiwater','westee'))
order by m.title";
$this->view->metadata=$this->db->fetchAll($sql);
$sql="select m.uuid,m.title,m.citation,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year
from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>4 and m.title like '黑河综合遥感联合试验%' order by title";
from heihemetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>4 and m.title like '黑河综合遥感联合试验%' order by title";
$this->view->water=$this->db->fetchAll($sql);
$sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year
from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>0 and m.title like '黑河生态水文遥感试验%' order by title";
from heihemetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>0 and m.title like '黑河生态水文遥感试验%' order by title";
$this->view->hiwater=$this->db->fetchAll($sql);
$sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year
from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='heihe' and s.status>0 and m.title not like '黑河生态水文遥感试验%' order by title";
from heihemetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='heihe' and s.status>0 and m.title not like '黑河生态水文遥感试验%' order by title";
$this->view->heihe=$this->db->fetchAll($sql);
$sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year
from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='westee' and s.status>4 order by title";
from heihemetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='westee' and s.status>4 order by title";
$this->view->westee=$this->db->fetchAll($sql);
}

View File

@ -42,12 +42,12 @@ class IndexController extends Zend_Controller_Action
$sql="select * from datasetcd order by random()";
$this->view->datasetcd=$this->db->fetchRow($sql);
//下载最多数据(top 5)
$sql="select uuid,title,id from normalmetadata where id in (select m.id from normalmetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=0 group by m.id order by count(d.uuid) desc limit 5)";
$sql="select uuid,title,id from heihemetadata where id in (select m.id from heihemetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=0 group by m.id order by count(d.uuid) desc limit 5)";
$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$this->view->mdtop=$this->db->fetchAll($sql);
$sql="select uuid,title,id from normalmetadata where id in (select m.id from normalmetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=1 group by m.id order by count(d.uuid) desc limit 5)";
$sql="select uuid,title,id from heihemetadata where id in (select m.id from heihemetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=1 group by m.id order by count(d.uuid) desc limit 5)";
$this->view->offlinemdtop=$this->db->fetchAll($sql);
$sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where length(t.data)>2 order by random()";
$sql="select m.uuid,m.title,m.id,m.description from heihemetadata m left join thumbnail t on m.id=t.id where length(t.data)>2 order by random()";
$this->view->mdrandom=$this->db->fetchRow($sql);
//搜索
$this->view->addHelperPath('helper','Zend_View_Helper_');
@ -85,7 +85,7 @@ class IndexController extends Zend_Controller_Action
$this->view->list_news = $rows;
$sql="select d.*,m.ts_published as publish_year from datadoi d left join metadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4";
$sql="select d.*,m.ts_published as publish_year from datadoi d right join heihemetadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4";
$sth = $this->db->query($sql);
$this->view->dois = $sth->fetchAll();

View File

@ -15,8 +15,6 @@ $this->headTitle()->setSeparator(' - ');
<a class="btn btn-info" href="/heihe/"><i class="icon-folder-open"></i>黑河计划数据管理中心</a>
<a class="btn btn-info" href="/hiwater"><i class="icon-folder-open"></i>黑河生态水文遥感试验</a>
<a class="btn btn-info" href="/water"><i class="icon-folder-open"></i>黑河综合遥感联合试验</a>
<a class="btn btn-info disabled" href="/glacier"><i class="icon-folder-open"></i>中国冰川资源及其变化调查</a>
<a class="btn btn-info disabled" href="/yrnmr"><i class="icon-folder-open"></i>黄河上游宁蒙河段数据</a>
</div>
<div class="span12">
<h4><i class="icon-flag"></i>特色导航</h4>
@ -94,7 +92,7 @@ $this->headTitle()->setSeparator(' - ');
</div>
<div class="row">
<div class="span6">
<h4><img src="/images/dbs.png" align="absmiddle" />数据导航</h4>
<div class="fieldlist">
<fieldset><legend><a href="/data/category">数据集类别</a></legend>
<ul class="unstyled inline">
@ -102,19 +100,19 @@ $this->headTitle()->setSeparator(' - ');
<li><a href='/data/category/code/<?php echo $cg['code']; ?>'><i class="icon-th-large"></i><?php (empty($cg['name_zh']))?print($cg['name']):print($cg['name_zh']); ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<?php endforeach; ?>
</ul></fieldset>
</div>
<div class="fieldlist">
<?php if ($this->serie) : ?>
<div id='series' class="fieldlist">
<fieldset><legend><a href="/data/series">数据集序列</a></legend>
<ul class="unstyled inline">
<?php foreach($this->serie as $cg) : ?>
<li><a href='/data/series/<?php echo $cg['id']; ?>'><i class="icon-list-ol"></i><?php echo $cg['name']; ?></a><span class="note">(<?php echo $cg['count']; ?>)</span></li>
<?php endforeach; ?>
</ul></fieldset>
</div>
<?php endif; ?>
</div>
</div>
<h4><img src="/images/Project24x24_24-bit.png" align="absmiddle" />&nbsp;数据服务</h4>
<div class="items">
<div class="item">
<ul class="unstyled">
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/offlineapp">离线数据服务记录最近20个</a></li>
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/request">如何从数据中心申请数据</a></li>
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/submit">如何在数据中心发布数据</a></li>
</ul>
</div>
</div>
</div><!-- /left -->
<div class="span6">
<div class="news_list">
@ -127,18 +125,7 @@ $this->headTitle()->setSeparator(' - ');
</ul>
</div>
<div>
<h4><img src="/images/Project24x24_24-bit.png" align="absmiddle" />&nbsp;数据服务</h4>
<div class="items">
<div class="item">
<ul class="unstyled">
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/offlineapp">离线数据服务记录最近20个</a></li>
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/request">如何从西部数据中心申请数据</a></li>
<li>-&nbsp;&nbsp;&nbsp;<a href="/data/submit">如何在西部数据中心发布数据</a></li>
</ul>
</div>
</div>
</div>

View File

@ -70,8 +70,8 @@
</ul>
<h4>数据服务</h4>
<span><a href="/data/offlineapp"><i class="icon-user"></i>最近20条离线数据服务记录</a></span><span>(共<?= $this->offlinenum; ?>)</span><br />
<span><a href="/data/request"><i class="icon-tint"></i>如何申请数据</a></span>
<span><a href="/data/submit"><i class="icon-tint"></i>如何发布数据</a></span>
<span><a class="btn btn-danger" href="/data/request"><i class="icon-tint"></i>如何申请数据</a></span>
<span><a class="btn btn-danger" href="/data/submit"><i class="icon-tint"></i>如何发布数据</a></span>
</div>
<div class="span8">
@ -93,8 +93,6 @@
<li><a href="/heihe"><i class="icon-folder-open"></i>黑河计划数据管理中心</a></li>
<li><a href="/hiwater"><i class="icon-folder-open"></i>黑河生态水文遥感试验</a></li>
<li><a href="/water"><i class="icon-folder-open"></i>黑河综合遥感联合试验</a></li>
<li><a href="/glacier"><i class="icon-folder-open"></i>中国冰川资源及其变化调查</a></li>
<li><a href="/yrnmr"><i class="icon-folder-open"></i>黄河上游宁蒙河段数据</a></li>
</ul>
<!-- <hr />
<h4>友情链接</h4>