diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 6fe5da49..f04a9c73 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -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)) { $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 - ,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 + ,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, date(ona.ts_created) as ona_tscreated from dataorder d left join metadata md on md.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") { - $this->_helper->viewRenderer('statics-time'); - $this->view->datas = $this->getStaticByYear("dataorder"); + $this->_helper->viewRenderer('statics-time'); + $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 mdauthor a ON md.uuid=a.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"; $sth = $this->db->prepare($sql); $sth->execute(array($uid)); @@ -3000,23 +3000,15 @@ class AuthorController extends Zend_Controller_Action /* * getStaticByYear按月份获取统计数据 */ - public function getStaticByYear($ac,$year=0){ - - if(empty($year)) - { - $year = date("Y",time()); - } + public function getStaticByYear($year=0) + { + $uid=Zend_Auth::getInstance()->getIdentity()->id; - - if($ac == "dataorder") - { - $table = "dataorder"; - $time_field = "ts_created"; - $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"; + $sql = "select to_char(o.ts_created, 'YYYY-MM') as d , count(o.id) as c from dataorder o + where o.status in (0,5) and o.uuid in (select uuid from mdauthor where status=1 and userid=".$uid.")"; + if ($year>0) + $sql.=" and o.ts_created between '$year-01-01' and '$year-12-31' "; + $sql.=" group by d order by d desc"; $sth = $this->db->prepare($sql); $sth->execute(); diff --git a/application/default/views/scripts/author/statics-md.phtml b/application/default/views/scripts/author/statics-md.phtml index a3b3cd19..4082a0f6 100644 --- a/application/default/views/scripts/author/statics-md.phtml +++ b/application/default/views/scripts/author/statics-md.phtml @@ -36,7 +36,7 @@ $this->breadcrumb()->setSeparator(' > '); } if(isset($this->offlineorder)) { - echo "
点击:".$v['viewed']." | 下载:".$v['down']."
点击:".$v['viewed']." | 下载:".$v['down']."
【离线申请】 ()
+【离线申请】 ()
+申请时间:
单位:
项目:
@@ -54,7 +55,8 @@ $this->breadcrumb()->setSeparator(' > ');
if(!empty($item['ona_id'])):
?>
【在线下载记录】 () 【在线下载记录】 () 申请时间: 单位: 项目: