Skip to content

Commit

Permalink
增加计划任务脚本
Browse files Browse the repository at this point in the history
优化查询效率和速度
  • Loading branch information
zyx0814 committed Sep 9, 2018
1 parent f9f5e8d commit 6c14a37
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 238 deletions.
4 changes: 3 additions & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

2. 应用市场应用名称旁显示版本;

3. 其他功能完善、及已知问题的修复;
3. 修复评论组件,有些情况下获取不到评论列表的bug;

4. 其他功能完善、及已知问题的修复;


### DzzOffice在线更新方法
Expand Down
4 changes: 2 additions & 2 deletions admin/cloud/template/movetool.htm
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@
<dl>
<dt>{lang file_size}:</dt>
<dd class="clearfix ">
<div class="input-group pull-left" style="width:100px"> <span class="input-group-addon">{lang typename_attach_lt}</span>
<div class="input-group pull-left" style="width:100px"> <span class="input-group-addon">{lang typename_attach_gt}</span>
<input type="text" class="form-control" name="router[size][lt]" style="width:60px;" value="" />
<span class="input-group-addon">M</span> </div>
<div class="pull-left ml20 mr20" style="line-height:30px;"> AND</div>
<div class="input-group pull-left" style="width:100px"> <span class="input-group-addon">{lang typename_attach_gt}</span>
<div class="input-group pull-left" style="width:100px"> <span class="input-group-addon">{lang typename_attach_lt}</span>
<input type="text" class="form-control" name="router[size][gt]" value="" style="width:60px;" />
<span class="input-group-addon">M</span> </div>
</dd>
Expand Down
11 changes: 10 additions & 1 deletion core/class/dzz/dzz_io.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,16 @@ function getFileContent($path){
//返回我文件data;
function setFileContent($path,$data,$force=false,$nocover = true){
$path=self::clean($path);
if($io=self::initIO($path)) return $io->setFileContent($path,$data,$force,$nocover);
if($io=self::initIO($path)) {
if($data = $io->setFileContent($path,$data,$force,$nocover)){
$filedata = $data;
\Hook::listen('setfilecontent_after', $filedata);
return $data;
}else{
return false;
}

}
else return false;
}

Expand Down
46 changes: 0 additions & 46 deletions core/class/perm/perm_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,53 +69,7 @@ function getPerm($fid, $bz='',$i=0){
return 3;
}
}
/*function getPerm($fid, $bz=''){
global $_G;
if($paths=C::t('resources_path')->fetch($fid)){
$pfids=array_reverse((array)explode('-',str_replace('_','',$paths['pathkey'])));
foreach($pfids as $fid){
if($folder=C::t('folder')->fetch($fid)){
$perm=intval($folder['perm']);
$power=new perm_binPerm($perm);
if($folder['gid']){
if(C::t('organization_admin')->chk_memberperm($folder['gid'],$_G['uid'])) return perm_binPerm::getGroupPower('all');

if($power->isPower('flag')){//不继承,使用此权限
if($_G['setting']['allowshare']){
$perm=$power->delPower('share');
}
$power1=new perm_binPerm($perm);
return $power1->power;//mergePower(self::getuserPerm());
}else{ //继承上级,查找上级
if($folder['pfid']>0 && $folder['pfid']!=$folder['fid']){ //有上级目录
continue;
}else{ //其他的情况使用
return perm_binPerm::getGroupPower('read');
}
}
}else{
if($power->isPower('flag')){//不继承,使用此权限
if($_G['setting']['allowshare']){
$perm=$power->delPower('share');
}
$power1=new perm_binPerm($perm);
return $power1->mergePower(self::getuserPerm());;
}else{ //继承上级,查找上级
if($folder['pfid']>0 && $folder['pfid']!=$folder['fid']){ //有上级目录
//return self::getPerm($folder['pfid'],$bz,$i);
continue;
}else{ //其他的情况使用
return self::getuserPerm();
}
}
}
}
}
return 7;
}else{
return 7;
}
}*/
function getPerm1($fid, $bz='',$i=0,$newperm = 0){
global $_G;

Expand Down
9 changes: 4 additions & 5 deletions core/class/table/table_attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ public function getAttachByFilter($filter,$sizecount=false){ //统计占用空
if($filter['aid']){
$where.=" and aid={$filter['aid']}";
}
$filter['sizelt']=intval($filter['sizelt'])*1024*1024;
$filter['sizelt']=intval($filter['sizelt']*1024*1024);
if($filter['sizelt']>0){
$where.=" and filesize>'{$filter[sizelt]}'";
$where.=" and filesize>$filter[sizelt]";
}
$filter['sizegt']=intval($filter['sizegt'])*1024*1024;;
$filter['sizegt']=intval($filter['sizegt']*1024*1024);
if($filter['sizegt']>0){
$where.=" and filesize<'{$filter[sizegt]}'";
$where.=" and filesize<$filter[sizegt]";
}
if($filter['exts']){
$extarr=explode(',',$filter['exts']);
Expand All @@ -142,7 +142,6 @@ public function getAttachByFilter($filter,$sizecount=false){ //统计占用空
$where.=" and aid NOT IN (".dimplode($ignores).")";
}
}

if($sizecount) return DB::result_first("SELECT sum(filesize) FROM ".DB::table($this->_table)." WHERE $where ");
else return DB::fetch_first("SELECT * FROM ".DB::table($this->_table)." WHERE $where order by dateline");

Expand Down
9 changes: 2 additions & 7 deletions core/class/table/table_folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,11 @@ public function fetch_folder_by_pfid($pfid, $field = array())
if ($folder = C::t('folder')->fetch($pfid)) {
$where1 = array();
if (!$this->noperm && $folder['gid'] > 0) {
$folder['perm'] = perm_check::getPerm($folder['fid']);
if ($folder['perm'] > 0) {
if (perm_binPerm::havePower('read2', $folder['perm'])) {
//$where1[]="uid!='{$_G[uid]}'"; //原来查询思路,read2权限只能看到其他人建立文件,不能看到自己的
if (perm_check::checkperm_Container($folder['fid'], 'read2')) {
$where1[] = "1";
} elseif (perm_binPerm::havePower('read1', $folder['perm'])) {
} elseif (perm_check::checkperm_Container($folder['fid'], 'read1')) {
$where1[] = "uid='{$_G[uid]}'";
}

}
$where1 = array_filter($where1);
if (!empty($where1)) $temp[] = "(" . implode(' OR ', $where1) . ")";
else $temp[] = "0";
Expand Down
Loading

0 comments on commit 6c14a37

Please sign in to comment.