remove unused code
This commit is contained in:
parent
59a257112d
commit
00ba57a340
|
@ -46,40 +46,7 @@ class DataController extends Zend_Controller_Action
|
|||
//最新10个入库数据
|
||||
$state=$this->db->query('select id,uuid,title from normalmetadata order by id desc limit 10');
|
||||
$this->view->metadata = $state->fetchAll();
|
||||
//特色数据
|
||||
|
||||
//服务
|
||||
$l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf");
|
||||
$this->view->newsletter=$l->getLast();
|
||||
$name=basename($this->view->newsletter,'.pdf');
|
||||
list(,$this->view->newsletterno)=explode("_",$name);
|
||||
|
||||
$this->view->addHelperPath('helper','Zend_View_Helper_');
|
||||
$form=new MaillistForm();
|
||||
$form->submit->setLabel('输入邮件地址,订阅数据通讯列表');
|
||||
|
||||
$this->view->form=$form;
|
||||
if ($this->_request->isPost()) {
|
||||
//发送邮件
|
||||
$formData=$this->_request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($formData['email']);
|
||||
$mail->setBodyText(".");
|
||||
$mail->setSubject('subscribe');
|
||||
$mail->addTo($this->view->config->reportemail);
|
||||
$mail->send();
|
||||
$this->messenger->addMessage('订阅成功,请检查您的邮件!');
|
||||
$this->_redirect('/data/');
|
||||
}
|
||||
} else {
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$user=$auth->getIdentity();
|
||||
$formData['email']=$user->email;
|
||||
$form->populate($formData);
|
||||
}
|
||||
}
|
||||
$searchform=new SearchForm();
|
||||
$this->view->searchform=$searchform;
|
||||
|
||||
|
|
|
@ -12,11 +12,6 @@ class IndexController extends Zend_Controller_Action
|
|||
|
||||
function indexAction()
|
||||
{
|
||||
//数据通讯
|
||||
$l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf");
|
||||
$this->view->newsletter=$l->getLast();
|
||||
$name=basename($this->view->newsletter,'.pdf');
|
||||
list(,$this->view->newsletterno)=explode("_",$name);
|
||||
//统计数据
|
||||
$sql='select (select count(*) from users) as usernum,(select count(*) from normalmetadata) as metanum,(select count(*) from offlineapp where ts_approved is not null ) as offlinenum';
|
||||
$row=$this->db->fetchRow($sql);
|
||||
|
@ -35,12 +30,6 @@ class IndexController extends Zend_Controller_Action
|
|||
else
|
||||
$this->view->onlinesize=$row['sum'];
|
||||
}
|
||||
//特色推荐
|
||||
$sql="select * from datafeature order by id desc";
|
||||
$this->view->feature=$this->db->fetchRow($sql);
|
||||
//特色数据集
|
||||
$sql="select * from datasetcd order by random()";
|
||||
$this->view->datasetcd=$this->db->fetchRow($sql);
|
||||
//下载最多数据(top 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 5)";
|
||||
$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
|
||||
|
@ -83,12 +72,7 @@ class IndexController extends Zend_Controller_Action
|
|||
$rows[$k]['type_url'] = $url['type_url'];
|
||||
}
|
||||
|
||||
$this->view->list_news = $rows;
|
||||
|
||||
$sql="select d.*,m.ts_published as publish_year from datadoi d right join normalmetadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4";
|
||||
$sth = $this->db->query($sql);
|
||||
$this->view->dois = $sth->fetchAll();
|
||||
|
||||
$this->view->list_news = $rows;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue