修复信息统计功能,申请查看增加申请时间

This commit is contained in:
wlx 2012-06-07 11:21:53 +00:00
parent 504abe8ddf
commit 141a6b3cd2
4 changed files with 19 additions and 25 deletions

View File

@ -242,8 +242,8 @@ class AuthorController extends Zend_Controller_Action
if(preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid)) if(preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
{ {
$sql = "select md.title,d.id as doid,d.uuid,d.authorpermitted,d.status $sql = "select md.title,d.id as doid,d.uuid,d.authorpermitted,d.status
,offa.id as offa_id,offa.username as offa_name,offa.unit as offa_unit,offa.email as offa_email,offa.project as offa_project ,offa.id as offa_id,offa.username as offa_name,offa.unit as offa_unit,offa.email as offa_email,offa.project as offa_project,date(offa.ts_created) as offa_tscreated
,ona.id as ona_id,ona.username as ona_name,ona.unit as ona_unit,ona.email as ona_email,ona.project as ona_project ,ona.id as ona_id,ona.username as ona_name,ona.unit as ona_unit,ona.email as ona_email,ona.project as ona_project, date(ona.ts_created) as ona_tscreated
from dataorder d from dataorder d
left join metadata md on md.uuid=d.uuid left join metadata md on md.uuid=d.uuid
left join mdauthor a on a.uuid=d.uuid left join mdauthor a on a.uuid=d.uuid
@ -2968,8 +2968,8 @@ class AuthorController extends Zend_Controller_Action
if($ac == "time") if($ac == "time")
{ {
$this->_helper->viewRenderer('statics-time'); $this->_helper->viewRenderer('statics-time');
$this->view->datas = $this->getStaticByYear("dataorder"); $this->view->datas = $this->getStaticByYear();
} }
@ -2988,7 +2988,7 @@ class AuthorController extends Zend_Controller_Action
LEFT JOIN mdstat s ON md.uuid=s.uuid LEFT JOIN mdstat s ON md.uuid=s.uuid
LEFT JOIN mdauthor a ON md.uuid=a.uuid LEFT JOIN mdauthor a ON md.uuid=a.uuid
LEFT JOIN dataorder o ON md.uuid=o.uuid LEFT JOIN dataorder o ON md.uuid=o.uuid
WHERE a.userid=? OR (o.status=0 or o.status=5) WHERE a.userid=? and a.status=1 and (o.status=0 or o.status=5)
GROUP BY md.title,md.uuid,s.viewed"; GROUP BY md.title,md.uuid,s.viewed";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(array($uid)); $sth->execute(array($uid));
@ -3000,23 +3000,15 @@ class AuthorController extends Zend_Controller_Action
/* /*
* getStaticByYear按月份获取统计数据 * getStaticByYear按月份获取统计数据
*/ */
public function getStaticByYear($ac,$year=0){ public function getStaticByYear($year=0)
{
if(empty($year)) $uid=Zend_Auth::getInstance()->getIdentity()->id;
{
$year = date("Y",time());
}
$sql = "select to_char(o.ts_created, 'YYYY-MM') as d , count(o.id) as c from dataorder o
if($ac == "dataorder") where o.status in (0,5) and o.uuid in (select uuid from mdauthor where status=1 and userid=".$uid.")";
{ if ($year>0)
$table = "dataorder"; $sql.=" and o.ts_created between '$year-01-01' and '$year-12-31' ";
$time_field = "ts_created"; $sql.=" group by d order by d desc";
$count_field = "id";
}
$sql = "select to_char(o.$time_field, 'YYYY-MM') as d , count(o.$count_field) as c from $table o
where o.ts_created between '$year-01-01' and '$year-12-12' group by d";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(); $sth->execute();

View File

@ -36,7 +36,7 @@ $this->breadcrumb()->setSeparator(' > ');
} }
if(isset($this->offlineorder)) if(isset($this->offlineorder))
{ {
echo "<li><h1>离线申请总数量:".$this->offlineorder."</h1><a href='/author/inauthor/ac/offline'>【查看离线申请】</a></li>"; echo "<li><h1>离线申请总数量:".$this->offlineorder."</h1><a href='/author/inauthor/ac/datalist'>【查看离线申请】</a></li>";
} }
if(isset($this->onlineorder)) if(isset($this->onlineorder))
{ {

View File

@ -35,7 +35,7 @@ $this->breadcrumb()->setSeparator(' > ');
{ {
foreach($this->alldata as $v) foreach($this->alldata as $v)
{ {
echo "<li><p><a target='_blank' href='/data/".$v['uuid']."'>".$v['title']."</a></p><p>点击:".$v['viewed']." | 下载:".$v['down']."</p></li>"; echo "<li><p><a target='_blank' href='/data/".$v['uuid']."'>".$v['title']."</a></p><p>点击:".$v['viewed']." | <a href='/author/inauthor/ac/datalist/uuid/".$v['uuid']."'>下载:".$v['down']."</a></p></li>";
} }
} }

View File

@ -43,7 +43,8 @@ $this->breadcrumb()->setSeparator(' > ');
if(!empty($item['offa_id'])) : if(!empty($item['offa_id'])) :
?> ?>
<li> <li>
<p>【离线申请】<?php echo $item['offa_name'];?> (<?php echo $item['offa_email'];?>)</p> <p>【离线申请】<?php echo $item['offa_name'];?> (<?php echo $item['offa_email'];?>)</p>
<p>申请时间:<?php echo $item['offa_tscreated'];?></p>
<p>单位:<?php echo $item['offa_unit'];?></p> <p>单位:<?php echo $item['offa_unit'];?></p>
<p>项目:<?php echo $item['offa_project'];?></p> <p>项目:<?php echo $item['offa_project'];?></p>
<p><span id="ct_<?php echo $item['doid'];?>"> <p><span id="ct_<?php echo $item['doid'];?>">
@ -54,7 +55,8 @@ $this->breadcrumb()->setSeparator(' > ');
if(!empty($item['ona_id'])): if(!empty($item['ona_id'])):
?> ?>
<li> <li>
<p>【在线下载记录】<?php echo $item['ona_name'];?> (<?php echo $item['ona_email'];?>)</p> <p>【在线下载记录】<?php echo $item['ona_name'];?> (<?php echo $item['ona_email'];?>)</p>
<p>申请时间:<?php echo $item['ona_tscreated'];?></p>
<p>单位:<?php echo $item['ona_unit'];?></p> <p>单位:<?php echo $item['ona_unit'];?></p>
<p>项目:<?php echo $item['ona_project'];?></p> <p>项目:<?php echo $item['ona_project'];?></p>
</li> </li>