...
|
...
|
@@ -135,17 +135,39 @@ class Home extends Base { |
|
|
|
|
|
// 通过时间来搜索uid
|
|
|
$uids = $mail->client->search(['SINCE'=>date('d-M-Y',$udate)],true);
|
|
|
if ($uids){
|
|
|
// 已有的uid
|
|
|
$useuids = db()->all(
|
|
|
sprintf(
|
|
|
"select `uid` from `%s` where `email_id` = %d and `folder_id` = %d and `uid` in (%s)",
|
|
|
listsSql::$table,
|
|
|
$email['id'],
|
|
|
$folder['id'],
|
|
|
implode(',',$uids)
|
|
|
)
|
|
|
);
|
|
|
$useuids = $useuids ? array_column($useuids,'uid') : [];
|
|
|
if($useuids){
|
|
|
// 删除多余的
|
|
|
foreach ($uids as $k=>$uid){
|
|
|
if(in_array($uid,$useuids)){
|
|
|
unset($uids[$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 进行同步
|
|
|
$mail->syncUidEmail(
|
|
|
$uids,
|
|
|
$email['id'],
|
|
|
$folder['origin_folder'],
|
|
|
$folder['id'],
|
|
|
[],
|
|
|
[],
|
|
|
db()
|
|
|
);
|
|
|
}
|
|
|
|
|
|
// 进行同步
|
|
|
$mail->syncUidEmail(
|
|
|
$uids,
|
|
|
$email['id'],
|
|
|
$folder['origin_folder'],
|
|
|
$folder['id'],
|
|
|
[],
|
|
|
[],
|
|
|
db()
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|