...
|
...
|
@@ -146,33 +146,36 @@ 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]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$us = [];
|
|
|
foreach ($uids as $k=>$uid){
|
|
|
if(!isset($us[intval($k/100)])) $us[intval($k/100)] = [];
|
|
|
$us[intval($k/100)][] = $uid;
|
|
|
}
|
|
|
if($uids){
|
|
|
$us = [];
|
|
|
foreach ($uids as $k=>$uid){
|
|
|
if(!isset($us[intval($k/100)])) $us[intval($k/100)] = [];
|
|
|
$us[intval($k/100)][] = $uid;
|
|
|
|
|
|
foreach ($us as $u){
|
|
|
// 已有的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(',',$u)
|
|
|
)
|
|
|
);
|
|
|
$useuids = $useuids ? array_column($useuids,'uid') : [];
|
|
|
if($useuids){
|
|
|
// 删除多余的
|
|
|
foreach ($u as $k=>$ui){
|
|
|
if(in_array($ui,$useuids)){
|
|
|
unset($u[$k]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
foreach ($us as $u){
|
|
|
|
|
|
if($u){
|
|
|
// 进行同步
|
|
|
$mail->syncUidEmail(
|
|
|
array_values($u),
|
...
|
...
|
@@ -185,8 +188,11 @@ class Home extends Base { |
|
|
);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
|