作者 邓超

mail del

... ... @@ -105,14 +105,15 @@ function sync($email_id){
$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));
$page++;
if($ids){
$ids = array_column($ids,'id','uid');
try {
$result = $mailServer->client->fetch(array_keys($ids),'UID',true);
$result = $mailServer->client->fetch(array_column($ids,'uid'),'UID',true);
$result = array_column($result,'UID');
}catch (Throwable $e){
return 0;
}
foreach ($ids as $uid=>$id){
foreach ($ids as $id){
$uid = $id['uid'];
$id = $id['id'];
if(!isset($result[$uid])){
_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]));
// 删除 如果远程没有,就删除本地
... ...