正在显示
2 个修改的文件
包含
28 行增加
和
0 行删除
| @@ -1165,6 +1165,32 @@ class Home extends Base { | @@ -1165,6 +1165,32 @@ class Home extends Base { | ||
| 1165 | } | 1165 | } |
| 1166 | 1166 | ||
| 1167 | 1167 | ||
| 1168 | + /** | ||
| 1169 | + * 重新把某个邮箱的数据同步到es | ||
| 1170 | + * 个人邮箱 绑定多个项目时非常重要 | ||
| 1171 | + * @return int | ||
| 1172 | + * @author:dc | ||
| 1173 | + * @time 2025/11/27 14:16 | ||
| 1174 | + */ | ||
| 1175 | + public function my_resync_to_es(){ | ||
| 1176 | + $id = 0; | ||
| 1177 | + $total = 0; | ||
| 1178 | + $email_id = intval(app()->request('email_id')); | ||
| 1179 | + while (1){ | ||
| 1180 | +// echo $id."\n"; | ||
| 1181 | + $mailLists = db()->all("select `id` from `lists` where `email_id` = {$email_id} and `id` > {$id} order by `id` asc limit 1000"); | ||
| 1182 | + if(empty($mailLists)){ | ||
| 1183 | + break; | ||
| 1184 | + } | ||
| 1185 | + foreach ($mailLists as $mailList){ | ||
| 1186 | + $total++; | ||
| 1187 | + $id = $mailList['id']; | ||
| 1188 | + redis()->rPush('sync_to_es',$id.'.1'); | ||
| 1189 | + } | ||
| 1190 | + } | ||
| 1191 | + | ||
| 1192 | + return $total; | ||
| 1193 | + } | ||
| 1168 | 1194 | ||
| 1169 | 1195 | ||
| 1170 | 1196 |
| @@ -55,6 +55,8 @@ return [ | @@ -55,6 +55,8 @@ return [ | ||
| 55 | 'v3/sync' => [\Controller\v3\Home::class, 'sync'], | 55 | 'v3/sync' => [\Controller\v3\Home::class, 'sync'], |
| 56 | // 重新同步收件箱到es库 | 56 | // 重新同步收件箱到es库 |
| 57 | 'resync_to_es' => [\Controller\Home::class, 'resync_to_es'], | 57 | 'resync_to_es' => [\Controller\Home::class, 'resync_to_es'], |
| 58 | + // 重新同步个人邮箱的 | ||
| 59 | + 'my_resync_to_es' => [\Controller\Home::class, 'my_resync_to_es'], | ||
| 58 | // 标记为已读 | 60 | // 标记为已读 |
| 59 | 'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'], | 61 | 'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'], |
| 60 | // 标记为已回复/未回复 | 62 | // 标记为已回复/未回复 |
-
请 注册 或 登录 后发表评论