add order condition in filelist

This commit is contained in:
wlx 2010-07-02 09:03:55 +00:00
parent 71d7141f6d
commit ef617da839
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ class FilelistController extends Zend_Controller_Action {
$uuid=$this->_request->getParam('uuid'); $uuid=$this->_request->getParam('uuid');
$filelist=new FilelistTable(); $filelist=new FilelistTable();
$adapter=$filelist->getAdapter(); $adapter=$filelist->getAdapter();
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id"); $db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' and depth=1 order by isdir desc,file_name");
$files=$db->fetchAll(); $files=$db->fetchAll();
$documents=array(); $documents=array();
$i=0; $i=0;
@ -28,7 +28,7 @@ class FilelistController extends Zend_Controller_Action {
$subPath=urldecode($getUrl); $subPath=urldecode($getUrl);
$filelist=new FilelistTable(); $filelist=new FilelistTable();
$adapter=$filelist->getAdapter(); $adapter=$filelist->getAdapter();
$db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' order by id"); $db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' and file_name ilike '$subpath%' order by isdir desc,file_name");
$files=$db->fetchAll(); $files=$db->fetchAll();
$documents=array(); $documents=array();
$i=0; $i=0;