正在显示
1 个修改的文件
包含
7 行增加
和
9 行删除
@@ -93,22 +93,20 @@ function sync($email_id){ | @@ -93,22 +93,20 @@ function sync($email_id){ | ||
93 | $ids = $db->all("select `id`,`uid` from ".\Model\listsSql::$table." where `email_id` = {$email_id} and `folder_id` = {$folder_id} and `udate` < ".strtotime("-1 day")." limit 100 offset ".($page*100)); | 93 | $ids = $db->all("select `id`,`uid` from ".\Model\listsSql::$table." where `email_id` = {$email_id} and `folder_id` = {$folder_id} and `udate` < ".strtotime("-1 day")." limit 100 offset ".($page*100)); |
94 | $page++; | 94 | $page++; |
95 | if($ids){ | 95 | if($ids){ |
96 | - foreach ($ids as $id){ | ||
97 | - $uid = $id['uid']; | ||
98 | - $id = $id['id']; | ||
99 | try { | 96 | try { |
100 | - $result = $mailServer->client->fetch($uid,'UID',true); | 97 | + $result = $mailServer->client->fetch(array_column($ids,'uid'),'UID',true); |
98 | + $result = array_column($result,'UID','UID'); | ||
101 | }catch (Throwable $e){ | 99 | }catch (Throwable $e){ |
102 | _echo($e->getMessage()); | 100 | _echo($e->getMessage()); |
103 | return; | 101 | return; |
104 | } | 102 | } |
105 | - if(!$result){ | ||
106 | - _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])); | 103 | + |
104 | + foreach ($ids as $id){ | ||
105 | + $uid = $id['uid']; $id = $id['id']; | ||
106 | + if(!$result || !isset($result[$uid])){ | ||
107 | // 删除 如果远程没有,就删除本地 | 107 | // 删除 如果远程没有,就删除本地 |
108 | -// }else{ | ||
109 | -// _echo($uid.' - '.json_encode($result)); | 108 | + _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])); |
110 | } | 109 | } |
111 | - | ||
112 | } | 110 | } |
113 | } | 111 | } |
114 | // 结束了 | 112 | // 结束了 |
-
请 注册 或 登录 后发表评论