From 3b50a5d20cec691d68eaa5cede83cd2f58ac53a1 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 2 Jul 2010 10:37:49 +0000 Subject: [PATCH] add limit with depth --- application/default/controllers/FilelistController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/default/controllers/FilelistController.php b/application/default/controllers/FilelistController.php index b6f54b53..e2e09356 100644 --- a/application/default/controllers/FilelistController.php +++ b/application/default/controllers/FilelistController.php @@ -26,9 +26,10 @@ class FilelistController extends Zend_Controller_Action { $uuid=$this->_request->getParam('uuid'); $getUrl=$this->_request->getParam('subpath'); $subPath=urldecode($getUrl); + $depth=substr_count($subPath,'/'); $filelist=new FilelistTable(); $adapter=$filelist->getAdapter(); - $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"); + $db=$adapter->query("select file_name,file_path,id,meta_uuid from westdc_fileinfo where meta_uuid='$uuid' and depth='$depth' and file_name ilike '$subpath%' order by isdir desc,file_name"); $files=$db->fetchAll(); $documents=array(); $i=0;