1、news category.id in(1)

This commit is contained in:
liheng 2018-07-26 11:22:36 +08:00
parent 7447ba6b71
commit 7f1b0306e5
1 changed files with 1 additions and 1 deletions

View File

@ -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_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 in(1,17)) 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 in(1)) order by ts_published desc LIMIT 12 ";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);