fix #473, 限制首页新闻的类别

This commit is contained in:
wlx 2013-05-07 01:10:44 +00:00
parent e3bb862fb2
commit 70d25ff303
1 changed files with 2 additions and 2 deletions

View File

@ -70,8 +70,8 @@ class IndexController extends Zend_Controller_Action
$this->view->news = $rows; $this->view->news = $rows;
$time = date("Y-m-d H:i:s",time()); //$time = date("Y-m-d H:i:s",time());
$sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<'$time' order by ts_published desc LIMIT 12 "; $sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<now() and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news') order by ts_published desc LIMIT 12 ";
$sth = $this->db->query($sql); $sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH); $rows = $sth->fetchAll(PDO::FETCH_BOTH);