From 76f912aaa31c64d79003840356ab92812fa32c61 Mon Sep 17 00:00:00 2001 From: zyx0814 Date: Mon, 11 Jul 2022 17:01:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/table/table_pichome_folder.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/class/table/table_pichome_folder.php b/core/class/table/table_pichome_folder.php index fea19db..4d386f5 100644 --- a/core/class/table/table_pichome_folder.php +++ b/core/class/table/table_pichome_folder.php @@ -107,12 +107,7 @@ class table_pichome_folder extends dzz_table public function fetch_all_folder_by_appid($appid,$pfid='',$i=1){ if($i>5) return []; - if(!$pfid) { - $pfidwhere = "and (pfid = %s or pfid = 0) "; - }else{ - $pfidwhere = "and pfid = %s "; - } - foreach(DB::fetch_all("select fid,fname,pathkey,pfid from %t where appid = %s and password = '' $pfidwhere",array($this->_table,$appid,$pfid)) as $v){ + foreach(DB::fetch_all("select fid,fname,pathkey,pfid from %t where appid = %s and password = '' and pfid = %s",array($this->_table,$appid,$pfid)) as $v){ $v['level'] = $i; $j = $i+1; $v['children'] = $this->fetch_all_folder_by_appid($appid,$v['fid'],$j); @@ -134,8 +129,7 @@ class table_pichome_folder extends dzz_table } }else{ - - foreach(DB::fetch_all("select fid,fname,pathkey,appid,pfid,filenum as nosubfilenum from %t where appid = %s and pfid = '' order by disp asc",array($this->_table,$appid)) as $v){ + foreach(DB::fetch_all("select fid,fname,pathkey,appid,pfid,filenum as nosubfilenum from %t where appid = %s and pfid = '' order by disp asc",array($this->_table,$appid)) as $v){ $v['filenum'] = DB::result_first("SELECT count(DISTINCT fr.rid) FROM %t fr left join %t f on fr.fid = f.fid where fr.appid = %s and f.pathkey like %s",array('pichome_folderresources','pichome_folder',$appid,$v['pathkey'].'%'));