diff --git a/application/default/controllers/FilelistController.php b/application/default/controllers/FilelistController.php index 5cc647d7..b6f54b53 100644 --- a/application/default/controllers/FilelistController.php +++ b/application/default/controllers/FilelistController.php @@ -4,7 +4,7 @@ class FilelistController extends Zend_Controller_Action { $uuid=$this->_request->getParam('uuid'); $filelist=new FilelistTable(); $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(); $documents=array(); $i=0; @@ -28,7 +28,7 @@ class FilelistController extends Zend_Controller_Action { $subPath=urldecode($getUrl); $filelist=new FilelistTable(); $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(); $documents=array(); $i=0;