merge sanjiangyuan-sub branch r4809 - r4816 into sjy-meteorology

This commit is contained in:
wlx 2014-06-18 06:52:54 +00:00
commit 80e62f05a7
4 changed files with 28 additions and 18 deletions

View File

@ -45,8 +45,10 @@ class DataController extends Zend_Controller_Action
$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 {$this->submd} order by id desc limit 10");
$state=$this->db->query("select id,uuid,title,ts_created from {$this->submd} order by ts_created desc limit 10");
$this->view->metadata = $state->fetchAll();
$state=$this->db->query("select m.id,m.uuid,m.title,s.viewed from {$this->submd} m left join mdstat s on m.uuid=s.uuid order by s.viewed desc limit 10");
$this->view->viewedmd = $state->fetchAll();
//服务
$searchform=new SearchForm();
$this->view->searchform=$searchform;
@ -1798,11 +1800,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 $this->submd");
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('normalmetadata as m','m.*')
$select->from($this->submd.' 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);

View File

@ -7,6 +7,7 @@
<div class="span12" style=" border-bottom:1px dashed #E0E0E0">
<form method="get" action="/search" id="search" class="form-search">
<a class="btn" href="/data/browse"><i class="icon-align-justify"></i>数据列表浏览</a>
<a class="btn" href="/data/thumb"><i class="icon-th"></i>缩略图浏览</a>
<a class="btn" href="/data/onlinelist"><i class="icon-th"></i>在线数据清单</a>
<a class="btn" href="/data/offlinelist"><i class="icon-th"></i>离线数据清单</a>
<a class="btn" href="/data/visual"><i class="icon-th"></i>可视化数据</a>
@ -31,17 +32,6 @@
<?php endforeach; ?>
</ul>
</div>
<?php
$type='discipline';
?>
<div class="span12" style="border-bottom:1px dashed #E0E0E0">
<h4><a href="/data/tag/keytype/discipline"><img src="/sjyportal/img/keyword.png" width="16" height="16" />&nbsp;<?php echo $keytypezh[$type]; ?></a></h4>
<ul class="nav nav-pills">
<?php foreach($this->keywords[$type] as $cg) : ?>
<li><a href='/data/tag/<?php echo $cg['keyword']; ?>'><?php echo $cg['keyword']." (". $cg['count'].")"; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<div class="row">
<?php
@ -67,4 +57,21 @@
</ul>
</div>
</div>
<div class="row">
<div class="span6">
<h4>数据最近更新<a href="/service/feed" target="_blank"><i class="icon-rss"></i></a></h4>
<ul class="unstyled">
<?php foreach($this->metadata as $md) : ?>
<li><i class="icon-map-marker"></i><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> [<?= date('Y-m-d',strtotime($md['ts_created'])) ?>]</li>
<?php endforeach; ?>
</ul>
</div>
<div class="span6">
<h4>最多浏览数据集</h4>
<ul class="unstyled">
<?php foreach($this->viewedmd as $md) : ?>
<li><i class="icon-map-marker"></i><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>[<?= $md['viewed'] ?>]</li>
<?php endforeach; ?>
</ul>
</div>
</div>

View File

@ -92,7 +92,7 @@
<a href="/data/<?= $v['uuid'] ?>" title="<?= $v['title'] ?>"><i class=" icon-map-marker"> </i><?= $v['title'] ?></a>
</li>
<?php } ?>
<span class="pull-right"><a href="/data" target="_blank" class="more">更多>></a></span>
<span class="pull-right"><a href="/data/onlinelist" target="_blank" class="more">更多>></a></span>
</ul>
</div>
</div>
@ -106,7 +106,7 @@
<a href="/data/<?= $v['uuid'] ?>" title="<?= $v['title'] ?>"><i class=" icon-map-marker"> </i><?= $v['title'] ?></a>
</li>
<?php } ?>
<span class="pull-right"><a href="/data" target="_blank" class="more">更多>></a></span>
<span class="pull-right"><a href="/data/offlinelist" target="_blank" class="more">更多>></a></span>
</ul>
</div>
</div>

View File

@ -115,7 +115,8 @@ class Visual
{
$sql = "SELECT * FROM {$this->metadataTable} md
LEFT JOIN {$this->mainTable} v ON v.uuid = md.uuid
WHERE v.uuid IS NOT NULL";
WHERE v.uuid IS NOT NULL
order by v.ts_changed desc";
$rs = $this->db->query($sql);
return $rs->fetchAll(\PDO::FETCH_ASSOC);