正在显示
1 个修改的文件
包含
7 行增加
和
8 行删除
@@ -105,20 +105,19 @@ function sync($email_id){ | @@ -105,20 +105,19 @@ function sync($email_id){ | ||
105 | $ids = $db->all("select `id`,`uid` from ".\Model\listsSql::$table." where `email_id` = {$email_id} and `folder_id` = {$folder_id} limit 100 offset ".($page*100)); | 105 | $ids = $db->all("select `id`,`uid` from ".\Model\listsSql::$table." where `email_id` = {$email_id} and `folder_id` = {$folder_id} limit 100 offset ".($page*100)); |
106 | $page++; | 106 | $page++; |
107 | if($ids){ | 107 | if($ids){ |
108 | - try { | ||
109 | - $result = $mailServer->client->fetch(array_column($ids,'uid'),'UID',true); | ||
110 | - $result = array_column($result,'UID'); | ||
111 | - }catch (Throwable $e){ | ||
112 | - return 0; | ||
113 | - } | ||
114 | foreach ($ids as $id){ | 108 | foreach ($ids as $id){ |
115 | $uid = $id['uid']; | 109 | $uid = $id['uid']; |
116 | $id = $id['id']; | 110 | $id = $id['id']; |
117 | - if(!in_array($uid,$result)){ | 111 | + try { |
112 | + $result = $mailServer->client->fetch($uid,'UID',true); | ||
113 | + }catch (Throwable $e){ | ||
114 | + continue; | ||
115 | + } | ||
116 | + if(!$result){ | ||
118 | _echo('删除 e '.$email_id.' f '.$folder_id.' u '.$uid.' id '.$id.' d '.$db->delete(\Model\listsSql::$table,['id'=>$id]).' fd '.$db->delete('fob_hot_mail',['lists_id'=>$id]).' body '.$db->delete(\Model\bodySql::$table,['lists_id'=>$id])); | 117 | _echo('删除 e '.$email_id.' f '.$folder_id.' u '.$uid.' id '.$id.' d '.$db->delete(\Model\listsSql::$table,['id'=>$id]).' fd '.$db->delete('fob_hot_mail',['lists_id'=>$id]).' body '.$db->delete(\Model\bodySql::$table,['lists_id'=>$id])); |
119 | // 删除 如果远程没有,就删除本地 | 118 | // 删除 如果远程没有,就删除本地 |
120 | - | ||
121 | } | 119 | } |
120 | + | ||
122 | } | 121 | } |
123 | } | 122 | } |
124 | // 结束了 | 123 | // 结束了 |
-
请 注册 或 登录 后发表评论