fix #473, 限制首页新闻的类别
This commit is contained in:
parent
e3bb862fb2
commit
70d25ff303
|
@ -70,8 +70,8 @@ class IndexController extends Zend_Controller_Action
|
|||
|
||||
$this->view->news = $rows;
|
||||
|
||||
$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 ";
|
||||
//$time = date("Y-m-d H:i:s",time());
|
||||
$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);
|
||||
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
|
||||
|
||||
|
|
Loading…
Reference in New Issue