update index news list

This commit is contained in:
jack 2018-02-11 18:59:02 +08:00
parent 220783d624
commit a0b5da631e
1 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class IndexController extends Zend_Controller_Action
$News = new Archive($this->db); $News = new Archive($this->db);
$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' AND image!='' and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='banner') order by ts_published desc LIMIT 5"; $sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<'$time' AND image IS NOT NULL AND image != '' and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='banner') order by ts_published desc LIMIT 5";
$sth = $this->db->query($sql); $sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH); $rows = $sth->fetchAll(PDO::FETCH_BOTH);
@ -64,7 +64,7 @@ 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<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.id=4) order by ts_published desc LIMIT 12 "; $sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<now() AND image IS NOT NULL AND image != '' and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.id=4) 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);