diff --git a/application/admin/controllers/NewsController.php b/application/admin/controllers/NewsController.php index e98b3640..b3781959 100644 --- a/application/admin/controllers/NewsController.php +++ b/application/admin/controllers/NewsController.php @@ -15,13 +15,24 @@ class Admin_NewsController extends Zend_Controller_Action } function indexAction() { - + $sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id order by n.writetime desc limit 10"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + $this->view->news = $rows; }//indexAction 首页 function newslistAction(){ - $sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id"; + $type = $this->_request->getParam('type'); + + if(!empty($type)) + { + $sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id WHERE n.typeid='$type' order by n.writetime desc"; + }else + { + $sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id order by n.writetime desc"; + } $rs = $this->db->query($sql); $rows = $rs->fetchAll(); @@ -238,16 +249,158 @@ class Admin_NewsController extends Zend_Controller_Action
新闻标题 | +所属栏目 | +新闻管理 | +
---|---|---|
+
+ '.$v['title'].'
+
+
+
+ 详细信息
+
+ 作者:'.$v['writer'].' +关键词:'.$v['keyword'].' +描述:'.$v['description'].' +添加时间:'.date("Y-m-d H:i",$v['writetime']).' +发布时间:'.date("Y-m-d H:i",$v['pubtime']).' +来源:'.$v['source'].' +点击:'.$v['click'].' + |
+ '.$v['catlog'].' | ++ 编辑 + 删除 | +
暂无数据 |