...
|
...
|
@@ -93,22 +93,20 @@ function sync($email_id){ |
|
|
$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));
|
|
|
$page++;
|
|
|
if($ids){
|
|
|
try {
|
|
|
$result = $mailServer->client->fetch(array_column($ids,'uid'),'UID',true);
|
|
|
$result = array_column($result,'UID','UID');
|
|
|
}catch (Throwable $e){
|
|
|
_echo($e->getMessage());
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
foreach ($ids as $id){
|
|
|
$uid = $id['uid'];
|
|
|
$id = $id['id'];
|
|
|
try {
|
|
|
$result = $mailServer->client->fetch($uid,'UID',true);
|
|
|
}catch (Throwable $e){
|
|
|
_echo($e->getMessage());
|
|
|
return;
|
|
|
}
|
|
|
if(!$result){
|
|
|
_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]));
|
|
|
$uid = $id['uid']; $id = $id['id'];
|
|
|
if(!$result || !isset($result[$uid])){
|
|
|
// 删除 如果远程没有,就删除本地
|
|
|
// }else{
|
|
|
// _echo($uid.' - '.json_encode($result));
|
|
|
_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]));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
// 结束了
|
...
|
...
|
|