添加时间排序

This commit is contained in:
wlx 2013-01-11 01:30:12 +00:00
parent 115ecc7872
commit 9399e82b8b
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,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<'$time' LIMIT 8";
$sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<'$time' LIMIT 8 order by ts_published desc";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);