调整WATER统计项,数据服务次数分为通过和拒绝,申请数从offlineapp直接判断

This commit is contained in:
wlx 2011-10-24 06:09:40 +00:00
parent 692331a90b
commit ee2e6b633e
2 changed files with 20 additions and 16 deletions

View File

@ -119,11 +119,11 @@ class Admin_StatController extends Zend_Controller_Action
function waterAction() function waterAction()
{ {
$sql="select count(k.keyword) as num,k.keyword from dataorder d join metadata m on d.uuid=m.uuid $sql="select count(k.keyword) as num,d.status,k.keyword from dataorder d left join metadata m on d.uuid=m.uuid
left join keyword k on m.id=k.id left join keyword k on m.id=k.id
where (d.status=5 or d.status=-1) and m.source!='' where (d.status=5 or d.status=-1) and m.source='0595169a-279e-4b95-819f-129d0ba4280d'
and (k.keyword='航空遥感' or k.keyword='卫星遥感' or k.keyword='气象水文' or k.keyword='上游寒区水文试验区' or k.keyword='森林水文试验区' or k.keyword='中游干旱区水文试验区') and (k.keyword='航空遥感' or k.keyword='卫星遥感' or k.keyword='气象水文' or k.keyword='上游寒区水文试验区' or k.keyword='森林水文试验区' or k.keyword='中游干旱区水文试验区')
group by k.keyword order by num desc"; group by k.keyword,d.status order by k.keyword desc,d.status desc";
$re =$this->db->query($sql); $re =$this->db->query($sql);
$type =$re->fetchAll();//按分类 $type =$re->fetchAll();//按分类
@ -141,13 +141,13 @@ class Admin_StatController extends Zend_Controller_Action
$this->view->month = $month; $this->view->month = $month;
$sql = "select count(extract(month from o.ts_created)) as c,extract(month from o.ts_created) as m,extract(year from o.ts_created) as y $sql = "select
from extract(year from o.ts_created) as y,extract(month from o.ts_created) as m,
(select distinct(o.id),o.ts_created count(extract(month from o.ts_created)) as c
from offlineapp o left join dataorder d on d.offlineappid=o.id left join metadata m on m.uuid=d.uuid from
where m.source='0595169a-279e-4b95-819f-129d0ba4280d' and (d.status=3 or d.status=5 or d.status=-1) (select distinct(o.id),o.ts_created
) as o from offlineapp o where o.datalist like '%黑河综合遥感联合试验%') as o
group by extract(month from o.ts_created),extract(year from o.ts_created) group by extract(month from o.ts_created),extract(year from o.ts_created)
order by extract(year from o.ts_created),extract(month from o.ts_created)"; order by extract(year from o.ts_created),extract(month from o.ts_created)";
$re=$this->db->query($sql); $re=$this->db->query($sql);

View File

@ -23,14 +23,18 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<td width="200">关键词</td> <td width="150">关键词</td>
<td width="100">数据服务次数</td> <td width="80">数据通过数</td>
<td width="80">数据拒绝数</td>
</tr> </tr>
</thead> </thead>
<?php <?php
foreach($this->type as $k=>$v) foreach($this->type as $k=>$v)
{ {
echo '<tr><td>'.$v['keyword'].'</td><td>'.$v['num'].'</td></tr>'; if ($v['status']==5)
echo '<tr><td>'.$v['keyword'].'</td><td>'.$v['num'].'</td>';
elseif ($v['status']==-1)
echo '<td>'.$v['num'].'</td></tr>';
} }
?> ?>
</table> </table>