切换首页数据集为下载最多的6条数据

This commit is contained in:
wlx 2015-12-12 18:47:57 +08:00
parent a3b09d6657
commit d300b57b51
2 changed files with 8 additions and 8 deletions

View File

@ -41,8 +41,8 @@ class IndexController extends Zend_Controller_Action
//特色数据集 //特色数据集
$sql="select * from datasetcd order by random()"; $sql="select * from datasetcd order by random()";
$this->view->datasetcd=$this->db->fetchRow($sql); $this->view->datasetcd=$this->db->fetchRow($sql);
//下载最多数据(top 5) //下载最多数据(top 6)
$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 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 6)";
$this->db->setFetchMode(Zend_Db::FETCH_OBJ); $this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$this->view->mdtop=$this->db->fetchAll($sql); $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 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)";

View File

@ -66,16 +66,16 @@
</div> </div>
<div class="data-list span4"> <div class="data-list span4">
<ul class="unstyled"> <ul class="unstyled">
<li><a href="/data/67d34a5a-4094-4d8a-93c8-9941e535b070">青海三江源区2012年重点生态工程区域草地监测数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[0]->uuid; ?>"><?php echo $this->mdtop[0]->title; ?></a></li>
<li><a href="/data/1963ba40-d436-4284-b6ef-65dbc7142750">青海三江源区2012年度土地利用数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[1]->uuid; ?>"><?php echo $this->mdtop[1]->title; ?></a></li>
<li><a href="/data/414489b0-ca05-4bbc-92a8-25b631518c46">青海三江源区2011年度土地利用数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[2]->uuid; ?>"><?php echo $this->mdtop[2]->title; ?></a></li>
</ul> </ul>
</div> </div>
<div class="data-list span4"> <div class="data-list span4">
<ul class="unstyled"> <ul class="unstyled">
<li><a href="/data/ac22fa94-b288-480a-8fdd-c34927968f17">青海三江源区2010年度土地利用数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[3]->uuid; ?>"><?php echo $this->mdtop[3]->title; ?></a></li>
<li><a href="/data/e6e1aa3d-e0d8-4dac-8d24-26d7cb1a164f">青海三江源区2011年卫星影像数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[4]->uuid; ?>"><?php echo $this->mdtop[4]->title; ?></a></li>
<li><a href="/data/a233150b-18a7-4786-b764-fe3483e480fa">青海三江源区2009年卫星影像数据集</a></li> <li><a href="/data/<?php echo $this->mdtop[5]->uuid; ?>"><?php echo $this->mdtop[5]->title; ?></a></li>
</ul> </ul>
</div> </div>
</div> </div>