From fc81c5559211f01b0f5a21d78d62001cb92b8dcc Mon Sep 17 00:00:00 2001 From: zyx0814 Date: Fri, 10 Dec 2021 09:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UPDATE.md | 8 ++--- dzz/pichome/ajax.php | 56 ++++++++++++++++++++--------------- dzz/pichome/filelist.php | 28 ++++++++++-------- install/data/install_data.sql | 2 +- 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/UPDATE.md b/UPDATE.md index 1570c7d..536a7ef 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -2,13 +2,11 @@ ### 1.增加普通目录导入支持,普通目录可限定文件导入,默认使用 “站点设置”=>“导入设置”中的“允许导入文件”中的设置值,可根据需要更改。 -### 2.支持选择或输入指定目录地址作为库;库更改为手动添加以便于自由选择eagle库或者普通目录库; - 目录选择中默认屏蔽了一些由系统生成目录,可在站点设置=>导入设置中的“禁止导入目录”中更改。 +### 2.支持选择或输入指定目录地址作为库;库更改为手动添加以便于自由选择eagle库或者普通目录库;目录选择中默认屏蔽了一些由系统生成目录,可在站点设置=>导入设置中的“禁止导入目录”中更改。 -###3.普通目录支持部分图片缩略图、颜色获取和部分音视频文件信息和缩略图获取(注:格式可参考 站点设置”=>“导入设置”中的“允许导入文件”;此功能 - pdf格式需有iamgick支持,linux下音视频需ffmpeg支持);该功能可在库的“设置”中选择开启或不开启,需要注意的是开启该功能可能会占用大量服务器资源。 +### 3.普通目录支持部分图片缩略图、颜色获取和部分音视频文件信息和缩略图获取(注:格式可参考 站点设置”=>“导入设置”中的“允许导入文件”;此功能pdf格式需有iamgick支持,linux下音视频需ffmpeg支持);该功能可在库的“设置”中选择开启或不开启,需要注意的是开启该功能可能会占用大量服务器资源。 -###4.增加新的界面展示模板,可在 “站点设置”=>“界面设置”中切换 +### 4.增加新的界面展示模板,可在 “站点设置”=>“界面设置”中切换 ### 5.导入逻辑优化,优化导入效率,修复没有文件时,一直在导入状态的bug diff --git a/dzz/pichome/ajax.php b/dzz/pichome/ajax.php index dcf2b17..aa9397b 100644 --- a/dzz/pichome/ajax.php +++ b/dzz/pichome/ajax.php @@ -65,19 +65,23 @@ if ($operation == 'addsearch') {//增加关键词搜索次数 foreach(DB::fetch_all("select appid from %t where isdelete = 0",array('pichome_vapp')) as $v){ $vappids[] = $v['appid']; } - if ($appid) { - $wheresql .= ' and r.appid = %s and r.appid in(%n)'; - $para[] = $appid; - $para[] = $vappids; - if(!$fids && !$hassub){ - $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; - $params[] = 'pichome_folderresources'; - $wheresql .= ' and ISNULL(fr.fid)'; - } - + if(empty($vappids)){ + $wheresql .= ' and 0'; }else{ - $wheresql .= ' and r.appid in(%n)'; - $para[] = $vappids; + if ($appid) { + $wheresql .= ' and r.appid = %s and r.appid in(%n)'; + $para[] = $appid; + $para[] = $vappids; + if(!$fids && !$hassub){ + $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; + $params[] = 'pichome_folderresources'; + $wheresql .= ' and ISNULL(fr.fid)'; + } + + }else{ + $wheresql .= ' and r.appid in(%n)'; + $para[] = $vappids; + } } if ($fids) { if ($fids == 'not') { @@ -822,19 +826,23 @@ if ($operation == 'addsearch') {//增加关键词搜索次数 foreach(DB::fetch_all("select appid from %t where isdelete = 0",array('pichome_vapp')) as $v){ $vappids[] = $v['appid']; } - if ($appid) { - $wheresql .= ' and r.appid = %s and r.appid in(%n)'; - $para[] = $appid; - $para[] = $vappids; - if(!$fids && !$hassub){ - $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; - $params[] = 'pichome_folderresources'; - $wheresql .= ' and ISNULL(fr.fid)'; - } - + if(empty($vappids)){ + $wheresql .= ' and 0'; }else{ - $wheresql .= ' and r.appid in(%n)'; - $para[] = $vappids; + if ($appid) { + $wheresql .= ' and r.appid = %s and r.appid in(%n)'; + $para[] = $appid; + $para[] = $vappids; + if(!$fids && !$hassub){ + $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; + $params[] = 'pichome_folderresources'; + $wheresql .= ' and ISNULL(fr.fid)'; + } + + }else{ + $wheresql .= ' and r.appid in(%n)'; + $para[] = $vappids; + } } if ($fids) { if ($fids == 'not') { diff --git a/dzz/pichome/filelist.php b/dzz/pichome/filelist.php index a6a0203..165acf0 100644 --- a/dzz/pichome/filelist.php +++ b/dzz/pichome/filelist.php @@ -44,19 +44,23 @@ if ($operation == 'filelist') { foreach(DB::fetch_all("select appid from %t where isdelete = 0",array('pichome_vapp')) as $v){ $vappids[] = $v['appid']; } - if ($appid) { - $wheresql .= ' and r.appid = %s and r.appid in(%n)'; - $para[] = $appid; - $para[] = $vappids; - if(!$fids && !$hassub){ - $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; - $params[] = 'pichome_folderresources'; - $wheresql .= ' and ISNULL(fr.fid)'; - } - + if(empty($vappids)){ + $wheresql .= ' and 0'; }else{ - $wheresql .= ' and r.appid in(%n)'; - $para[] = $vappids; + if ($appid) { + $wheresql .= ' and r.appid = %s and r.appid in(%n)'; + $para[] = $appid; + $para[] = $vappids; + if(!$fids && !$hassub){ + $sql .= " LEFT JOIN %t fr on fr.rid = r.rid "; + $params[] = 'pichome_folderresources'; + $wheresql .= ' and ISNULL(fr.fid)'; + } + + }else{ + $wheresql .= ' and r.appid in(%n)'; + $para[] = $vappids; + } } if ($fids) { if ($fids == 'not') { diff --git a/install/data/install_data.sql b/install/data/install_data.sql index a7b68b2..cf6f862 100644 --- a/install/data/install_data.sql +++ b/install/data/install_data.sql @@ -173,7 +173,7 @@ INSERT INTO `dzz_setting` VALUES ('pichomeimportnotdir', 'patch,srv,run,lib64,sy INSERT INTO `dzz_imagetype` VALUES(1, 1, '默认', 'smiley', 0, 'dzz'); -INSERT INTO `dzz_user_setting` VALUES ('1',''1', 'pichomeimageexpanded', '1'); +INSERT INTO `dzz_user_setting` VALUES ('1','1', 'pichomeimageexpanded', '1'); -- -- 转存表中的数据 `dzz_user_profile_setting`