From a0b5da631e3c54e750f6ab4865d5a71778ad219f Mon Sep 17 00:00:00 2001 From: jack Date: Sun, 11 Feb 2018 18:59:02 +0800 Subject: [PATCH] update index news list --- application/default/controllers/IndexController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index 68db35cc..2d3ae937 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -51,7 +51,7 @@ class IndexController extends Zend_Controller_Action $News = new Archive($this->db); $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); $rows = $sth->fetchAll(PDO::FETCH_BOTH); @@ -64,7 +64,7 @@ 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_publisheddb->query($sql); $rows = $sth->fetchAll(PDO::FETCH_BOTH);