作者 邓超

x

... ... @@ -1165,6 +1165,32 @@ class Home extends Base {
}
/**
* 重新把某个邮箱的数据同步到es
* 个人邮箱 绑定多个项目时非常重要
* @return int
* @author:dc
* @time 2025/11/27 14:16
*/
public function my_resync_to_es(){
$id = 0;
$total = 0;
$email_id = intval(app()->request('email_id'));
while (1){
// echo $id."\n";
$mailLists = db()->all("select `id` from `lists` where `email_id` = {$email_id} and `id` > {$id} order by `id` asc limit 1000");
if(empty($mailLists)){
break;
}
foreach ($mailLists as $mailList){
$total++;
$id = $mailList['id'];
redis()->rPush('sync_to_es',$id.'.1');
}
}
return $total;
}
... ...
... ... @@ -55,6 +55,8 @@ return [
'v3/sync' => [\Controller\v3\Home::class, 'sync'],
// 重新同步收件箱到es库
'resync_to_es' => [\Controller\Home::class, 'resync_to_es'],
// 重新同步个人邮箱的
'my_resync_to_es' => [\Controller\Home::class, 'my_resync_to_es'],
// 标记为已读
'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'],
// 标记为已回复/未回复
... ...