更新总平台调取关于部分的方法

This commit is contained in:
wlx 2014-06-12 07:49:56 +00:00
parent da10875105
commit 63f1962657
2 changed files with 22 additions and 7 deletions

View File

@ -48,37 +48,37 @@ class AboutController extends Zend_Controller_Action
function backgroundAction() function backgroundAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('发展历史','about'); $this->view->item=$archives->getAboutArchive('发展历史','about');
} }
function legalAction() function legalAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('隐私政策','about'); $this->view->item=$archives->getAboutArchive('隐私政策','about');
} }
function supportusAction() function supportusAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('支持我们','about'); $this->view->item=$archives->getAboutArchive('支持我们','about');
} }
function copyrightAction() function copyrightAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('数据与版权','about'); $this->view->item=$archives->getAboutArchive('数据与版权','about');
} }
function linkAction() function linkAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('友情链接','about'); $this->view->item=$archives->getAboutArchive('友情链接','about');
} }
function honorAction() function honorAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('服务成效','about'); $this->view->item=$archives->getAboutArchive('服务成效','about');
} }
function sponsorsAction() function sponsorsAction()
{ {
$archives=new Archive($this->db); $archives=new Archive($this->db);
$this->view->item=$archives->getOneArchive('支持项目','about'); $this->view->item=$archives->getAboutArchive('支持项目','about');
} }
function publicationAction() function publicationAction()
{ {

View File

@ -602,6 +602,21 @@ class Archive
return $rows; return $rows;
}//getOneArchive }//getOneArchive
//getAboutArchive 获取总平台的关于我们文档
function getAboutArchive($title)
{
$sql="update ".$this->tbl_archives." set click=click+1";
$this->db->query($sql);
$sql = "select a.* from ".$this->tbl_archives." a
left join ".$this->tbl_catalog." ac on a.id=ac.aid
left join ".$this->tbl_categorys." c on ac.cid=c.id ";
$sql.=" where a.title=? and c.ptype='about' and a.sub=''";
$sth=$this->db->prepare($sql);
$sth->execute(array($title,$ptype));
$rows=$sth->fetch();
return $rows;
}//getAboutArchive
/* /*
* getArchiveField() 读取某个文档的某个字段 * getArchiveField() 读取某个文档的某个字段
* *