作者 邓超

x

... ... @@ -147,8 +147,12 @@ class SyncToEsCmd {
list($doc_id,$data) = $data;
// 主库
$this->bulkData->add('email_lists_copy',$doc_id,$data);
if($data['postid']){
// 分库
$this->bulkData->add('email_lists_branch_'.$data['postid'],$doc_id,$data);
}
// 个人邮箱的情况
if(!$data['postid']){
$postids = $this->getPostids($data['email_id']);
if($postids){
foreach ($postids as $postid){
... ... @@ -157,12 +161,10 @@ class SyncToEsCmd {
// 分库 个人邮箱
$this->bulkData ->add('email_lists_branch_'.$postid,$doc_id,$data);
}
}else{
// 分库 其他 非fob数据源
$this->bulkData->add('email_lists_branch_0',$doc_id,$data);
}
}else{
// 分库
// 其他非fob邮件数据
if (!$data['postid']){
// 分库 其他 非fob数据源
$this->bulkData->add('email_lists_branch_'.$data['postid'],$doc_id,$data);
}
... ... @@ -177,7 +179,7 @@ class SyncToEsCmd {
* @time 2025/8/5 14:53
*/
private function getPostids($email_id){
$postids = $this->fob_db->throw()->cache(300)->all("select `post_id` from `e_mail_binds` where `source` = 1 and `email_id` = {$email_id} and `deleted_at` is null");
$postids = $this->fob_db->throw()->cache(1800)->all("select `post_id` from `e_mail_binds` where `source` = 1 and `email_id` = {$email_id} and `deleted_at` is null");
if($postids){
return array_column($postids,'post_id');
... ...