正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
@@ -128,16 +128,16 @@ function sync($email_id){ | @@ -128,16 +128,16 @@ function sync($email_id){ | ||
128 | // $folders = list_to_tree($folders); | 128 | // $folders = list_to_tree($folders); |
129 | foreach ($folders as $folder){ | 129 | foreach ($folders as $folder){ |
130 | try { | 130 | try { |
131 | - | ||
132 | - if(empty($folder['_child'])){ | ||
133 | - $call($email_id,$folder['id'],$folder['origin_folder']); | ||
134 | - }else{ | ||
135 | - foreach ($folder['_child'] as $item){ | ||
136 | - // 同步子文件夹 | ||
137 | - $call($email_id,$item['id'],$item['origin_folder']); | 131 | + $is = true; |
132 | + foreach ($folders as $f){ | ||
133 | + // 是否存在下级 | ||
134 | + if($f['pid'] == $folder['id']){ | ||
135 | + $is = false; | ||
138 | } | 136 | } |
139 | } | 137 | } |
140 | 138 | ||
139 | + if($is) $call($email_id,$folder['id'],$folder['origin_folder']); | ||
140 | + | ||
141 | }catch (\Throwable $e){ | 141 | }catch (\Throwable $e){ |
142 | echo $e->getMessage(); | 142 | echo $e->getMessage(); |
143 | } | 143 | } |
-
请 注册 或 登录 后发表评论