From ef617da8397ad77d94ef4670f7a28b56b7db920b Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 2 Jul 2010 09:03:55 +0000 Subject: [PATCH] add order condition in filelist --- application/default/controllers/FilelistController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;